1. Introduction
HTTP extensions (as defined in Section 16 of [HTTP]) sometimes need to access underlying transport protocol features such as unreliable delivery (as offered by [QUIC-DGRAM]) to enable desirable features. For example, this could allow for the introduction of an unreliable version of the CONNECT method and the addition of unreliable delivery to WebSockets [WEBSOCKET].
In Section 2, this document describes HTTP Datagrams, a convention for conveying bidirectional and potentially unreliable datagrams inside an HTTP connection, with multiplexing when possible. While HTTP Datagrams are associated with HTTP requests, they are not a part of message content. Instead, they are intended for use by HTTP extensions (such as the CONNECT method) and are compatible with all versions of HTTP.
When HTTP is running over a transport protocol that supports unreliable delivery (such as when the QUIC DATAGRAM extension [QUIC-DGRAM] is available to HTTP/3 [HTTP/3]), HTTP Datagrams can use that capability.
In Section 3, this document describes the HTTP Capsule Protocol, which allows the conveyance of HTTP Datagrams using reliable delivery. This addresses HTTP/3 cases where use of the QUIC DATAGRAM frame is unavailable or undesirable or where the transport protocol only provides reliable delivery, such as with HTTP/1.1 [HTTP/1.1] or HTTP/2 [HTTP/2] over TCP [TCP].
1.1. Conventions and Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This document uses terminology from [QUIC].
Where this document defines protocol types, the definition format uses the notation from Section 1.3 of [QUIC]. Where fields within types are integers, they are encoded using the variable-length integer encoding from Section 16 of [QUIC]. Integer values do not need to be encoded on the minimum number of bytes necessary.
In this document, the term "intermediary" refers to an HTTP intermediary as defined in Section 3.7 of [HTTP].