WebTransport

open class WebTransport(url: String, options: WebTransportOptions = definedExternally)(source)

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. Available only in secure contexts.

MDN Reference

Constructors

Link copied to clipboard
constructor(url: URL, options: WebTransportOptions = definedExternally)
constructor(url: String, options: WebTransportOptions = definedExternally)

Properties

Link copied to clipboard

The closed read-only property of the WebTransport interface returns a promise that resolves when the transport is closed.

Link copied to clipboard

The datagrams read-only property of the WebTransport interface returns a WebTransportDatagramDuplexStream instance that can be used to send and receive datagrams — unreliable data transmission.

Link copied to clipboard

The incomingBidirectionalStreams read-only property of the WebTransport interface represents one or more bidirectional streams opened by the server.

Link copied to clipboard

The incomingUnidirectionalStreams read-only property of the WebTransport interface represents one or more unidirectional streams opened by the server.

Link copied to clipboard

The ready read-only property of the WebTransport interface returns a promise that resolves when the transport is ready to use.

Functions

Link copied to clipboard
fun close(closeInfo: WebTransportCloseInfo = definedExternally)

The close() method of the WebTransport interface closes an ongoing WebTransport session.

Link copied to clipboard

The createBidirectionalStream() method of the WebTransport interface asynchronously opens and returns a bidirectional stream.

Link copied to clipboard
suspend fun createUnidirectionalStream(options: WebTransportSendStreamOptions = definedExternally): WritableStream<*>

The createUnidirectionalStream() method of the WebTransport interface asynchronously opens a unidirectional stream.