Skip to content

Transport bindings

  • Both bindings MUST run over TLS (https/wss), except ws:// on loopback for development.
  • The server MUST validate the Origin header on both bindings against a configured allow-list when browser clients are expected (§14). A request without an Origin header is not subject to the allow-list: browsers always send Origin on WebSocket upgrades and WebTransport CONNECT requests, so its absence means a non-browser client.
  • Authentication credentials MUST NOT be sent in the URL. They are sent in HELLO (§7.1). Cookies attached by the browser to the upgrade/CONNECT request MAY also be used.
  • Exactly one session runs on one transport. Before HELLO a transport carries no frames except a server CLOSE; after CLOSE it carries none.
  • TLS early data (0-RTT): servers MUST NOT process HELLO or any other frame received in TLS 1.3 / QUIC 0-RTT early data, because early data can be replayed. Servers either disable 0-RTT or defer reading until the handshake completes.
  • Pre-WELCOME pipelining: after sending HELLO, a client MAY send further frames without waiting for WELCOME (this saves one round trip on every connect and resume). Before WELCOME a client MUST NOT send more than 64 KiB of frames after HELLO. The server MUST NOT process them before authentication succeeds; it buffers them subject to a pre-authentication buffer limit (default and minimum 64 KiB) and closes with LIMIT_EXCEEDED if it is exceeded. Servers MUST accept at least 64 KiB of pipelined frames. The 64 KiB floor on max_frame and window binds both peers: a server MUST NOT advertise either below 64 KiB in WELCOME, so a client that knows no server limits yet can always pipeline within them, and a client MUST NOT advertise either below 64 KiB in HELLO; a HELLO that does is malformed (§7.1). Pipelined frames carry seq when the client requested resume (§7.8); a server that does not grant resume ignores seq. On REJECT, or CLOSE received before WELCOME, everything pipelined is discarded and the client library fails pending calls locally with UNAVAILABLE (§8.4, nx: true). A transport loss before WELCOME arrives is not proof of that (the server may already have sent WELCOME and processed the frames). Servers MUST NOT send anything but WELCOME, REJECT or CLOSE before WELCOME.

HTTP refusals. A server that refuses an upgrade or CONNECT request answers with these statuses on HTTP/1.1, HTTP/2 and HTTP/3, for both bindings:

Condition Status
pavia.1 not offered (§4.2, §4.3) 400 Bad Request
Origin present and not allowed 403 Forbidden
Per-address rate limit (§14) 429 Too Many Requests, with Retry-After
  • The client establishes a WebTransport session to https://host{path} (HTTP/3 extended CONNECT, :protocol = webtransport).
  • Draft divergence [verify]: as of 2026, browsers do not all speak the same WebTransport draft (Chromium and Firefox have used an early draft; Safari and the current IETF draft a later one). A conforming server MUST accept every draft version used by the browsers it claims to support. This is a transport-library concern; the Pavia protocol is identical across drafts.
  • Control stream: the client MUST open one client-initiated bidirectional stream immediately after the session is established. This is stream 0: the client-initiated bidirectional stream with the lowest stream ID in the WebTransport session. Its first frame MUST be HELLO. The client MAY open further streams before receiving WELCOME (pipelining, §4.1); the server MUST NOT read or act on them until it has sent WELCOME, and MUST reset them on REJECT. To bound pre-authentication memory, the server SHOULD keep QUIC connection and stream flow-control windows small (e.g. 64 KiB total) until WELCOME and raise them afterwards. A server that receives a higher-numbered stream before the control stream MUST park it until the control stream arrives (up to the handshake timeout) rather than treating it as an error.
  • One session per connection: a server MUST NOT accept more than one WebTransport session per QUIC connection: it advertises a maximum of one session and refuses further CONNECT requests on the connection. Connection-level QUIC limits are then session limits. The QUIC MAX_STREAMS limit for client-initiated bidirectional streams allows max_calls concurrent call streams plus one for the control stream.
  • Subprotocol: clients SHOULD request pavia.1 via the WebTransport protocols option where the browser supports it, and servers select it [verify browser support]. A CONNECT without a protocol list is accepted; only a list that does not contain pavia.1 is a mismatch, refused with 400 (§4.1).
  • Idle alignment: each endpoint advertises a QUIC max_idle_timeout greater than Pavia idle (§7.4), otherwise QUIC ends the session before Pavia can decide whether it is a transport loss. Recommended: idle + 15 s. The effective QUIC idle timeout is the smaller of both endpoints’ values (RFC 9000 §10.1), and a browser chooses its own. A server whose client advertises a value that leaves less than 15 s of margin MUST lower WELCOME idle and hb. When the effective QUIC idle timeout is above 30 s, idle is at least 15 s below it. When it is 30 s or less, idle is half the effective timeout, so idle never reaches zero. In both cases hb is at most idle / 3.
  • Send order: where the runtime exposes stream priorities (the WebTransport sendOrder option), the control stream MUST have the highest priority, followed by lane streams, then call streams (§6.6) [verify support].
  • Call streams: each call uses a new bidirectional QUIC stream opened by the caller (client or server). Stream IDs are QUIC’s; no Pavia stream ID appears on the wire.
  • Lane streams: each non-zero lane uses a unidirectional stream opened by the sender (§9.2).
  • Datagrams: use WebTransport datagrams (§11.3).
  • Flow control and stream limits are QUIC’s. The server SHOULD configure its QUIC MAX_STREAMS limits to match the max_calls it advertises in WELCOME (see above for the control stream).
  • Framing on a stream: frames are concatenated without stream ID prefix (§5.3).
  • Closing: a session is closed with a WebTransport session close carrying the Pavia close code (§15.1) as the application error code and a UTF-8 reason.
  • Local development: browsers accept self-signed certificates for WebTransport only via the serverCertificateHashes option, which imposes certificate constraints (short validity, specific key types) [verify current constraints]. Server tooling SHOULD provide a development mode that generates a compliant certificate and prints its hash.
  • The client connects to wss://host{path} with Sec-WebSocket-Protocol: pavia.1. The server MUST select pavia.1 or refuse the upgrade with 400 (§4.1).
  • HTTP/1.1 upgrade MUST be supported by servers. WebSockets over HTTP/2 (RFC 8441) and HTTP/3 (RFC 9220) MAY be supported.
  • The subprotocol name identifies the framing version (§5); protocol semantics within that framing are negotiated by versions in HELLO (§7.1). A new framing would be pavia.2.
  • An HTTP/1.1 request on the endpoint path that is not a WebSocket upgrade MUST be answered 426 Upgrade Required (with Upgrade: websocket). Over HTTP/2 and HTTP/3, a request on the path that is not an extended CONNECT MUST be answered 405 Method Not Allowed (with Allow: CONNECT). The well-known sub-path (§12.6) is exempt from both rules.
  • Servers MUST NOT negotiate permessage-deflate in v1 (compression of credential-bearing frames alongside attacker-influenced data enables CRIME/BREACH-class attacks; see §18 for future compression).
  • Only binary WebSocket messages are allowed. A text message is a PROTOCOL_ERROR.
  • A WebSocket message contains one or more complete frames, each prefixed by its stream ID (§5.4). A frame MUST NOT be split across WebSocket messages. Senders MAY batch frames of different streams into one message. A WebSocket message MUST NOT exceed 2 × max_frame bytes; receivers enforce this before buffering (PROTOCOL_ERROR).
  • Client send backpressure: the browser WebSocket API has no send backpressure. A client runtime MUST watch bufferedAmount (or use WebSocketStream where available) and treat a high-water mark (default 1 MiB) as “no credit”: until the buffer drains it holds frames of scheduling classes 3 to 5 (§6.6: new CALLs and ITEMs, NOTIFY, control requests, datagrams, with the datagram coalescing rules of §11.4); frames of classes 1 and 2 (PING, PONG, CLOSE, CANCEL, CREDIT, RESULT, ERROR, END, ACK) are always written.
  • All streams, including stream 0, are multiplexed by stream ID (§6.1).
  • Per-stream flow control uses CREDIT frames (§6.4).
  • Datagrams are emulated with DATAGRAM frames on stream 0 (§11.4).
  • Lane streams are multiplexed like call streams and provide no independence on WebSocket, because TCP delivers everything in order (§9.2).
  • Closing: send CLOSE (§7.7), then a WebSocket close with code 4000 + pavia_close_code (§15.1).
  • Inbound backpressure: a server whose unprocessed inbound bytes for a session exceed a limit (default 1 MiB) stops reading the socket, letting TCP apply backpressure. While it is not reading it MUST pause its own idle timer for that session (it cannot see PONGs), and it MUST resume reading within the slow-consumer grace period (§13.5) or close with SLOW_CONSUMER.

Clients that support both bindings SHOULD use this algorithm:

  1. If WebTransport is available in the runtime and the origin is not in the client’s WebTransport failure cache, start a WebTransport attempt.
  2. Start a WebSocket attempt either when the WebTransport attempt fails or after a head-start delay (default 250 ms), whichever comes first.
  3. The first attempt to receive WELCOME wins. The loser is closed with close code NORMAL (or abandoned if not yet established). While more than one attempt is in flight, a client sends only HELLO on each; it pipelines further frames (§4.1) only on an attempt that is the only one in flight, so the same frame is never processed by two sessions.
  4. If WebTransport failed or lost the race, record the origin in the failure cache for a configurable period (default 24 h), so future sessions go straight to WebSocket.
  5. Resumption (§7.8) MAY switch bindings: a session started on WebTransport can resume on WebSocket and vice versa.
  6. WELCOME MAY carry transports (key 46), the bindings the server offers on this endpoint. A client that connected over WebSocket and sees webtransport listed SHOULD shorten the failure-cache entry for the origin so that it expires 1 h after the failure was recorded (the hint never extends an entry); a lost race is not proof that WebTransport is blocked.

Rationale: some networks block UDP, and a failed QUIC handshake can take seconds to time out. Racing hides that delay.

Aspect WebTransport WebSocket
Head-of-line blocking between calls None Present (TCP)
Flow control QUIC native CREDIT frames
Datagrams Real, unreliable Emulated, reliable, coalesced
Lanes Independent streams Accepted, no independence
Network migration (Wi-Fi ↔ cellular) QUIC connection migration [verify browser support] Requires resumption
Stream IDs on wire No Yes

From the specification: §4.1, §4.2, §4.3, §4.4, §4.5.