WebTransport

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The WebTransport interface of the WebTransport API provides functionality to enable a user agent to connect to an HTTP/3 server, initiate reliable and unreliable transport in either or both directions, and close the connection once it is no longer needed.

Constructor

WebTransport()

Creates a new WebTransport object instance.

Instance properties

closed Read only

Returns a promise that resolves when the transport is closed.

datagrams Read only

Returns a WebTransportDatagramDuplexStream instance that can be used to send and receive datagrams.

congestionControl Read only Experimental

Returns a string that indicates the application preference for either high throughput or low-latency when sending data.

incomingBidirectionalStreams Read only

Represents one or more bidirectional streams opened by the server. Returns a ReadableStream of WebTransportBidirectionalStream objects. Each one can be used to read data from the server and write data back to it.

incomingUnidirectionalStreams Read only

Represents one or more unidirectional streams opened by the server. Returns a ReadableStream of WebTransportReceiveStream objects. Each one can be used to read data from the server.

ready Read only

Returns a promise that resolves when the transport is ready to use.

reliability Read only Experimental

Returns a string that indicates whether the connection supports reliable transports only, or whether it also supports unreliable transports (such as UDP).