Back to Content

WebTransportReceiveStream

files/en-us/web/api/webtransportreceivestream/index.md

latest2.0 KB
Original Source

{{APIRef("WebTransport API")}}{{securecontext_header}} {{AvailableInWorkers}}

The WebTransportReceiveStream interface of the {{domxref("WebTransport API", "WebTransport API", "", "nocode")}} is a {{domxref("ReadableStream")}} that can be used to read from an incoming unidirectional or bidirectional {{domxref("WebTransport")}} stream.

The stream is a readable byte stream of Uint8Array, and can be consumed using either a BYOB reader (ReadableStreamBYOBReader) or the default reader (ReadableStreamDefaultReader).

Objects of this type are not constructed directly. Instead they are obtained using the WebTransport.incomingUnidirectionalStream property.

WebTransportReceiveStream is a transferable object.

{{InheritanceDiagram}}

Instance properties

Inherits properties from its parent interface, {{domxref("ReadableStream")}}.

Instance methods

Also inherits properties from its parent interface, {{domxref("ReadableStream")}}.

  • {{domxref("WebTransportReceiveStream.getStats()")}}
    • : Returns a {{jsxref("Promise")}} that resolves with statistics related to this stream.

Examples

See WebTransport.incomingUnidirectionalStreams for an example of how to get a {{domxref("ReadableStream")}} of WebTransportReceiveStream objects.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also