Capsule-Protocol
The HTTP Capsule-Protocol request or response header indicates the HTTP Datagram and Capsule Protocol is in use on a CONNECT or extended CONNECT tunnel.
Usage
When establishing a CONNECT or extended CONNECT tunnel for protocols like CONNECT-UDP, CONNECT-IP, or WebTransport, endpoints use the Capsule-Protocol header to signal support for HTTP Datagrams and the Capsule Protocol. This enables multiplexed, potentially unreliable datagram transmission inside an HTTP/2 or HTTP/3 connection.
The header carries a boolean value ?1 using the
Structured Fields syntax. The header is an
advisory indication that simplifies processing for intermediaries.
Whether capsules are used on a tunnel is determined by the
definition of the protocol or upgrade token in use, not by a
mutual header exchange.
The Capsule Protocol provides a general convention for conveying datagrams in HTTP connections. When QUIC DATAGRAM frames are unavailable or unsuitable, the Capsule Protocol offers an alternative transport method for datagrams over HTTP. This approach complements the protocol upgrade mechanism by extending HTTP's capability to carry non-HTTP protocols over persistent connections.
Values
?1
The boolean value ?1 indicates support for the HTTP Datagram and
Capsule Protocol. The value follows Structured Fields boolean
syntax, where ?1 represents true. A false value ?0 is also
defined and carries the same meaning as omitting the header.
Example
A client establishing a UDP proxying tunnel through extended
CONNECT with the connect-udp protocol includes the header to
indicate the Capsule Protocol is in use. The server echoes the
header in the response. WebTransport endpoints define capsule use
through the protocol itself and ignore this header.
Capsule-Protocol: ?1
See also
- RFC 9297: HTTP Datagrams and the Capsule Protocol
- Protocol Upgrade
- CONNECT
- HTTP/2
- HTTP/3
- Structured Fields
- HTTP headers