method
quic.QuicSession.createBidirectionalStream
Open a new bidirectional stream. If the body option is not specified, the stream's outgoing side remains writable and no FIN is sent immediately. The priority and incremental options are only used when the session supports priority (e.g. HTTP/3). The headers, onheaders, ontrailers, oninfo, and onwanttrailers options are only used when the session supports headers (e.g. HTTP/3).
Referenced types
interface CreateStreamOptions
- body?: StreamBody
The outbound body source. See
stream.setBody()for details on supported types. When omitted, the stream's outgoing side remains writable with no body queued; no FIN is sent immediately. - headers?: readonly string[] | Dict<string | readonly string[]>
Initial request or response headers to send. Only used when the session supports headers (e.g. HTTP/3). If
bodyis not specified andheadersis provided, the stream is treated as headers-only (terminal). - highWaterMark?: number
The maximum number of bytes that the writer will buffer before
writeSync()returnsfalse. When the buffered data exceeds this limit, the caller should wait for drain before writing more. Default:65536(64 KB). - incremental?: boolean
When
true, data from this stream may be interleaved with data from other streams of the same priority level. Whenfalse, the stream should be completed before same-priority peers. Default:false. - onheaders?: (this: QuicStream, headers: Dict<string | string[]>) => void
Callback for received initial response headers. Called with
(headers). - oninfo?: (this: QuicStream, headers: Dict<string | string[]>) => void
Callback for received informational (1xx) headers. Called with
(headers). - ontrailers?: (this: QuicStream, trailers: Dict<string | string[]>) => void
Callback for received trailing headers. Called with
(trailers). - priority?: 'default' | 'high' | 'low'
The priority level of the stream. One of
'high','default', or'low'. Default:'default'.
namespace QuicStream
class Stats