WebTransport API
The WebTransportReceiveStream interface of the WebTransport API is a ReadableStream that can be used to read from an incoming unidirectional or bidirectional 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.
Instance properties
Inherits properties from its parent interface, ReadableStream.
Instance methods
Also inherits properties from its parent interface, ReadableStream.
- WebTransportReceiveStream.getStats()
- : Returns a Promise that resolves with statistics related to this stream.
Examples
See WebTransport.incomingUnidirectionalStreams for an example of how to get a ReadableStream of WebTransportReceiveStream objects.
Specifications
Browser compatibility
See also
- Using WebTransport
- Streams API
- WebTransport over HTTP/3
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
