Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The WebTransportDatagramDuplexStream
interface of the WebTransport API represents a duplex stream that can be used for unreliable transport of datagrams between client and server. Provides access to a ReadableStream
for reading incoming datagrams, a WritableStream
for writing outgoing datagrams, and various settings and statistics related to the stream.
This is accessed via the WebTransport.datagrams
property.
"Unreliable" means that transmission of data is not guaranteed, nor is arrival in a specific order. This is fine in some situations and provides very fast delivery. For example, you might want to transmit regular game state updates where each message supersedes the last one that arrives, and order is not important.
Note: This feature is available in Web Workers