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.
| Layer | Role in WebTransport | Key mechanism |
|---|---|---|
| W3C WebTransport API | JavaScript interface in the browser | Streams API objects and promises |
| HTTP/3 extended CONNECT | Creates and names the session | :protocol value webtransport |
| QUIC streams | Carry reliable, ordered data | Independent flow control per stream |
| QUIC DATAGRAM frames | Carry unreliable messages | Extension defined in RFC 9221 |
| TLS 1.3 | Authenticates and encrypts traffic | Integrated into the QUIC handshake |
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.
| Primitive | Delivery guarantee | Typical use |
|---|---|---|
| Bidirectional stream | Reliable, ordered, both directions | Request-response exchanges and RPC calls |
| Unidirectional stream | Reliable, ordered, one direction | Media segments, file chunks and logs |
| Datagram | Best effort, unordered, size-limited | Game state, cursor positions and sensor samples |
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.
| Property | WebSocket | WebRTC data channel | WebTransport |
|---|---|---|---|
| Underlying transport | TCP with TLS | SCTP over DTLS over UDP | QUIC over UDP |
| Unreliable delivery | Not available | Available | Available as datagrams |
| Multiple independent streams | No | Yes | Yes |
| Connection model | Client to server | Mainly peer to peer | Client to server |
| Setup complexity | Low | High, needs signaling | Moderate |
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.
| Situation | Recommended choice | Reason |
|---|---|---|
| Latency-sensitive state updates | WebTransport datagrams | Stale updates can be dropped instead of retransmitted |
| Many parallel independent transfers | WebTransport streams | No head-of-line blocking between streams |
| Simple chat or notifications | WebSocket | Mature tooling and broad network compatibility |
| Browser-to-browser media | WebRTC | Built-in NAT traversal and media pipeline |
| Cacheable content delivery | HTTP/3 requests | Standard caching and CDN support |
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
maxDatagramSizecauses 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.