While WebTransport uses HTTP/3, which in turn uses UDP "under the hood," WebTransport has requirements around encryption and congestion control that make it more than a basic UDP Socket API. Is WebTransport the same as a UDP Socket API? #
If you need something that works "out of the box" with common server setups, and with broad web client support, WebSockets is a better choice today. WebTransport is part of a new draft specification, and as such the WebSocket ecosystem around client and server libraries is currently much more robust. Additionally, there are performance benefits when establishing new connections, as the underlying QUIC handshake is faster than starting up TCP over TLS. Using WebTransport, via the datagram APIs or via multiple concurrent Streams API instances, means that you don't have to worry about head-of-line blocking, which can be an issue with WebSockets. In comparison, WebTransport's datagram APIs provide low-latency delivery, without guarantees about reliability or ordering, so they're not a direct replacement for WebSockets. If you need those characteristics, then WebTransport's streams APIs can provide them as well. WebSockets communications are modeled around a single, reliable, ordered stream of messages, which is fine for some types of communication needs. There are use cases where either WebSockets or WebTransport might be valid communication protocols to use. Launch Chromium 97 WebTransport's relationship to other technologies # Is WebTransport a replacement for WebSockets? # Gather feedback and iterate design Complete 4. Create initial draft of specification Complete 3. We're interested in hearing more about how you plan to use WebTransport.
Receiving media streams pushed from a server with minimal latency, independent of other data streams.Sending game state at a regular interval with minimal latency to a server via small, unreliable, out-of-order messages.This a small list of possible ways developers might use WebTransport. Using multiple WebTransport streams is analogous to establishing multiple TCP connections, but since HTTP/3 uses the lighter-weight QUIC protocol under the hood, they can be opened and closed without as much overhead. They're well-suited to scenarios where you need to send or receive one or more streams of ordered data. The streams APIs, in contrast, provide reliable, ordered data transfer. You can think of datagrams as user datagram protocol (UDP) messages, but encrypted and congestion-controlled. These characteristics make the datagram APIs ideal for low-latency, best-effort data transmission. Individual packets of data are limited in size by the maximum transmission unit (MTU) of the underlying connection, and may or may not be transmitted successfully, and if they are transferred, they may arrive in an arbitrary order. It supports sending data both unreliably via its datagram APIs, and reliably via its streams APIs.ĭatagrams are ideal for sending and receiving data that do not need strong delivery guarantees. It's intended for two-way communications between a web client and an HTTP/3 server. WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. Acknowledgements Background # What's WebTransport? #.Is WebTransport an alternative to WebRTC data channels?.
Is WebTransport the same as a UDP Socket API?.Is WebTransport a replacement for WebSockets?.WebTransport's relationship to other technologies.