As WebTransport sessions are established over HTTP/3, they are identified using
the https URI scheme ([HTTP], Section 4.2.2).¶
In order to create a new WebTransport session, a client can send an HTTP CONNECT
request. The :protocol pseudo-header field ([RFC8441]) MUST be set to
webtransport. The :scheme field MUST be https. Both the :authority
and the :path value MUST be set; those fields indicate the desired
WebTransport server. If the WebTransport session is coming from a browser
client, an Origin header [RFC6454] MUST be provided within the request;
otherwise, the header is OPTIONAL.¶
Upon receiving an extended CONNECT request with a :protocol field set to
webtransport, the HTTP/3 server can check if it has a WebTransport server
associated with the specified :authority and :path values. If it does not,
it SHOULD reply with status code 404 (Section 15.5.5 of [HTTP]).
When the request contains the Origin header, the WebTransport server MUST
verify the Origin header to ensure that the specified origin is allowed to
access the server in question. If the verification fails, the WebTransport
server SHOULD reply with status code 403 (Section 15.5.4 of [HTTP]). If all
checks pass, the WebTransport server MAY accept the session by replying with a
2xx series status code, as defined in Section 15.3 of [HTTP].¶
From the client's perspective, a WebTransport session is established when the client receives a 2xx response. From the server's perspective, a session is established once it sends a 2xx response.¶
The server may reply with a 3xx response, indicating a redirection (Section 15.4 of [HTTP]). The user agent MUST NOT automatically follow such redirects, as the client could potentially already have sent data for the WebTransport session in question; it MAY notify the client about the redirect.¶
Clients cannot initiate WebTransport in 0-RTT packets, as the CONNECT method is not considered safe; see Section 10.9 of [HTTP3]. However, WebTransport-related SETTINGS parameters may be retained from the previous session as described in Section 7.2.4.2 of [HTTP3]. If the server accepts 0-RTT, the server MUST NOT reduce the limit of maximum open WebTransport sessions from the one negotiated during the previous session; such change would be deemed incompatible, and MUST result in a H3_SETTINGS_ERROR connection error.¶
The webtransport HTTP Upgrade Token uses the Capsule Protocol as defined in
[HTTP-DATAGRAM]. The Capsule Protocol is negotiated when the server sends a
2xx response. The capsule-protocol header field Section 3.4 of [HTTP-DATAGRAM] is not required by WebTransport and can safely be ignored by WebTransport
endpoints.¶