WebTransport

On this page 7

WebTransport is a web API and protocol framework that lets a browser or other client open a secure, multiplexed session with a server and exchange data as reliable streams or unreliable datagrams, normally carried over HTTP/3 and QUIC. Among Internet protocols, it fills the gap between request-response HTTP and the single ordered byte stream of WebSocket.

The specification has two halves: the W3C WebTransport API, which defines the JavaScript interface, and the IETF protocol drafts that map sessions onto HTTP/3 and, as a fallback, onto HTTP/2. Typical users are real-time applications such as cloud gaming, live media ingest, collaborative editing and telemetry, where head-of-line blocking or retransmission delays hurt more than an occasional lost message.

How WebTransport sessions are established and carried

A WebTransport session begins as an extended CONNECT request with the :protocol pseudo-header set to webtransport and an https URL that identifies the server endpoint. Once the server answers with a 2xx status, the session exists inside the existing QUIC connection and both sides may open streams or send datagrams tagged with the session identifier.

Because the session rides on HTTP/3, it inherits TLS 1.3 encryption, QUIC congestion control and connection migration. Several WebTransport sessions, as well as ordinary HTTP requests, can share one QUIC connection when both endpoints negotiate support through HTTP/3 SETTINGS parameters.

The following table lists the protocol building blocks that a single session relies on.

LayerRole in WebTransportKey mechanism
W3C WebTransport APIJavaScript interface in the browserStreams API objects and promises
HTTP/3 extended CONNECTCreates and names the session:protocol value webtransport
QUIC streamsCarry reliable, ordered dataIndependent flow control per stream
QUIC DATAGRAM framesCarry unreliable messagesExtension defined in RFC 9221
TLS 1.3Authenticates and encrypts trafficIntegrated into the QUIC handshake
Protocol layers behind a WebTransport session

Stream and datagram types in WebTransport

WebTransport exposes three transfer primitives, and choosing the right one is the central design decision for any application. Streams are reliable and ordered within themselves, but loss on one stream never blocks another, which removes the transport-level head-of-line blocking that affects TCP-based protocols.

Datagrams are neither reliable nor ordered and must fit within a single QUIC packet, so their practical size is bounded by the path MTU, usually somewhat above 1,000 bytes after overhead. The browser reports the current limit through the maxDatagramSize attribute rather than a fixed constant.

PrimitiveDelivery guaranteeTypical use
Bidirectional streamReliable, ordered, both directionsRequest-response exchanges and RPC calls
Unidirectional streamReliable, ordered, one directionMedia segments, file chunks and logs
DatagramBest effort, unordered, size-limitedGame state, cursor positions and sensor samples
Transfer primitives and their typical uses

Applications often combine the primitives: a game may send player input as datagrams, push map assets on unidirectional streams and run chat over a bidirectional stream, all inside one session and one handshake.

WebTransport compared with WebSocket and WebRTC

WebTransport is best understood as a client-server alternative to WebSocket with the datagram flexibility that previously required WebRTC data channels. WebSocket runs over a single TCP connection and therefore suffers whenever one packet is lost, while WebRTC is built for peer-to-peer media and brings ICE, STUN and SCTP complexity that many server applications do not need.

PropertyWebSocketWebRTC data channelWebTransport
Underlying transportTCP with TLSSCTP over DTLS over UDPQUIC over UDP
Unreliable deliveryNot availableAvailableAvailable as datagrams
Multiple independent streamsNoYesYes
Connection modelClient to serverMainly peer to peerClient to server
Setup complexityLowHigh, needs signalingModerate
Comparison of browser transport options

Unlike plain HTTP/3 requests, WebTransport keeps a long-lived bidirectional session in which the server may open streams toward the client at any time. It does not replace HTTP for ordinary document and API traffic, where caching and standard semantics remain more valuable.

Deploying WebTransport in practice

Deployment requires a server or proxy that supports HTTP/3 with the WebTransport extensions, an open UDP port, usually 443, and a valid certificate. For development, the API accepts serverCertificateHashes, which pins a short-lived self-signed certificate valid for no more than two weeks instead of relying on a public certificate authority.

Networks that block UDP remain a real obstacle, so production systems need a fallback path. The IETF has specified a mapping over HTTP/2 on TCP, but support varies, and many teams still keep a WebSocket fallback for restrictive corporate networks.

The decision table below summarizes when the protocol is a sound choice.

SituationRecommended choiceReason
Latency-sensitive state updatesWebTransport datagramsStale updates can be dropped instead of retransmitted
Many parallel independent transfersWebTransport streamsNo head-of-line blocking between streams
Simple chat or notificationsWebSocketMature tooling and broad network compatibility
Browser-to-browser mediaWebRTCBuilt-in NAT traversal and media pipeline
Cacheable content deliveryHTTP/3 requestsStandard caching and CDN support
Choosing a transport for a real-time web feature

Limitations and common mistakes

WebTransport is still maturing: browser support is uneven, the protocol drafts have changed wire details between versions, and server libraries must match the draft version that clients negotiate. Teams should test interoperability explicitly rather than assume that any HTTP/3 server will accept sessions.

  • Treating datagrams as reliable leads to silent data loss; critical messages belong on streams.
  • Sending datagrams larger than maxDatagramSize causes them to be dropped without delivery.
  • Ignoring congestion control and flow control limits can stall streams under load.
  • Opening a new stream for every tiny message adds overhead; batching often performs better.
  • Assuming UDP reachability everywhere leaves users on filtered networks without any connection.

Explained without jargon

WebTransport is a newer way for a web page to keep an open, fast line to a server. Older methods send everything through one pipe in strict order, so one lost piece makes everything behind it wait.

WebTransport opens many small pipes at once and also lets the page toss quick notes that may get lost. That sounds careless, but for a moving game character the newest position matters more than an old one. The key idea is simple: send each kind of data the way it deserves, carefully when it must arrive and quickly when only the latest value counts.

A typical use case

A browser-based multiplayer racing game sends each player’s car position 60 times per second. Over WebSocket, a single lost TCP packet on a congested mobile network delayed every later update, and cars visibly stuttered for 150 to 300 milliseconds at a time.

The developers moved position updates to WebTransport datagrams, each about 200 bytes and stamped with a sequence number so that older ones are ignored. Track assets load over unidirectional streams, and lap results and purchases use a bidirectional stream because they must never be lost.

After the change, a lost packet costs only one frame of position data, and the next datagram corrects it about 17 milliseconds later. For players on networks that block UDP, the client detects the failure and falls back to WebSocket, accepting higher latency instead of no connection.