{
  "type": "module",
  "source": "doc/api/quic.md",
  "modules": [
    {
      "textRaw": "QUIC",
      "name": "quic",
      "introduced_in": "v23.8.0",
      "type": "module",
      "meta": {
        "added": [
          "v23.8.0"
        ],
        "changes": []
      },
      "stability": 1,
      "stabilityText": "Early development",
      "desc": "<p>The 'node:quic' module provides an implementation of the QUIC protocol.\nTo access it, start Node.js with the <code>--experimental-quic</code> option and:</p>\n<pre><code class=\"language-mjs\">import quic from 'node:quic';\n</code></pre>\n<pre><code class=\"language-cjs\">const quic = require('node:quic');\n</code></pre>\n<p>The module is only available under the <code>node:</code> scheme.</p>",
      "modules": [
        {
          "textRaw": "Overview",
          "name": "overview",
          "type": "module",
          "desc": "<p>The <code>quic</code> module provides APIs for creating QUIC clients and servers.</p>",
          "modules": [
            {
              "textRaw": "Relevant RFCs and specifications",
              "name": "relevant_rfcs_and_specifications",
              "type": "module",
              "desc": "<p>The QUIC and HTTP/3 protocols are defined by a collection of RFCs produced\nprimarily by the IETF QUIC Working Group. A familiarity with these documents\nis strongly recommended for users of this module.</p>\n<p><strong>Core QUIC transport:</strong></p>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc8999\">RFC 8999</a> — Version-Independent Properties of QUIC</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9000\">RFC 9000</a> — QUIC: A UDP-Based Multiplexed and Secure Transport</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9001\">RFC 9001</a> — Using TLS to Secure QUIC</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9002\">RFC 9002</a> — QUIC Loss Detection and Congestion Control</li>\n</ul>\n<p><strong>Core HTTP/3:</strong></p>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9114\">RFC 9114</a> — HTTP/3</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9204\">RFC 9204</a> — QPACK: Field Compression for HTTP/3</li>\n</ul>\n<p><strong>QUIC extensions:</strong></p>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9221\">RFC 9221</a> — An Unreliable Datagram Extension to QUIC</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9287\">RFC 9287</a> — Greasing the QUIC Bit</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9368\">RFC 9368</a> — Compatible Version Negotiation for QUIC</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9369\">RFC 9369</a> — QUIC Version 2</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9443\">RFC 9443</a> — Multiplexing Scheme Updates for QUIC</li>\n</ul>\n<p><strong>HTTP/3 extensions:</strong></p>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9218\">RFC 9218</a> — Extensible Prioritization Scheme for HTTP</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9220\">RFC 9220</a> — Bootstrapping WebSockets with HTTP/3</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9297\">RFC 9297</a> — HTTP Datagrams and the Capsule Protocol</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9412\">RFC 9412</a> — The ORIGIN Extension in HTTP/3</li>\n</ul>\n<p><strong>Operational and informational:</strong></p>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9308\">RFC 9308</a> — Applicability of the QUIC Transport Protocol</li>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9312\">RFC 9312</a> — Manageability of the QUIC Transport Protocol</li>\n</ul>",
              "displayName": "Relevant RFCs and specifications"
            }
          ],
          "displayName": "Overview"
        },
        {
          "textRaw": "Architecture",
          "name": "architecture",
          "type": "module",
          "desc": "<p>The <code>quic</code> module is built around three core abstractions:</p>\n<ul>\n<li>\n<p><code>QuicEndpoint</code>: represents the local UDP socket binding for QUIC. It is\nused to send and receive QUIC packets and can be shared across multiple\nsessions. A single endpoint can be used as both a client and a server\nsimultaneously.</p>\n</li>\n<li>\n<p><code>QuicSession</code>: represents a QUIC connection between the local endpoint and\na remote peer. A session is created either by initiating a connection to a\nremote peer using <code>quic.connect()</code> or by accepting an incoming connection\nfrom a remote peer via <code>quic.listen()</code>.</p>\n</li>\n<li>\n<p><code>QuicStream</code>: represents a QUIC stream within a session. Streams are\ncreated by either local or remote peers and can be bidirectional or\nunidirectional.</p>\n</li>\n</ul>\n<p>Unlike traditional TCP-based protocols, QUIC \"connections\" are not inherently\ntied to a specific local port / remote port pair. A session is initiated via\na QUIC endpoint but may be migrated to a different local or remote address\nover its lifetime, outlive the endpoint that created it, and may even be\nassociated with multiple endpoints simultaneously. This flexibility allows for\nadvanced use cases such as connection migration, multi-homing, and load balancing.\nMost often, however, a simple one-to-one relationship between endpoint and session\nis sufficient.</p>",
          "modules": [
            {
              "textRaw": "Integrated TLS 1.3",
              "name": "integrated_tls_1.3",
              "type": "module",
              "desc": "<p>The QUIC protocol integrates TLS 1.3 directly into the protocol for connection\nestablishment and security. The <code>quic</code> module's API reflects this integration\nby exposing TLS-related information and configuration options. It is currently\nnot possible to use QUIC without TLS or to use a different version of TLS.</p>\n<p>Every QUIC session starts with the client and server performing a TLS handshake\nto negotiate the application protocol (via ALPN), authenticate the server (and\noptionally the client), exchange transport parameters, and establish shared keys\nfor encryption.</p>",
              "displayName": "Integrated TLS 1.3"
            },
            {
              "textRaw": "Applications",
              "name": "applications",
              "type": "module",
              "desc": "<p>Every <code>QuicSession</code> is associated with a single application protocol, negotiated\nvia ALPN during the TLS handshake. The <code>quic</code> module is designed to be\napplication-agnostic in general but includes built-in support for HTTP/3 as a\nspecific application protocol. When using HTTP/3, the <code>quic</code> module provides\nadditional APIs for handling HTTP/3-specific features such as headers, trailers,\nand prioritization. For other application protocols, users can implement their\nown message framing and multiplexing on top of the core QUIC transport features.</p>\n<p>When initiating a TLS handshake, the client will include a list of supported\nALPN protocols in the <code>ClientHello</code>. The server selects one of these protocols\n(if any) and includes it in the <code>ServerHello</code>. The negotiated protocol determines\nhow the <code>QuicSession</code> and <code>QuicStream</code> APIs behave. For example, when the <code>h3</code>\nprotocol is negotiated for HTTP/3, the <code>QuicSession</code> and <code>QuicStream</code> will support\nHTTP/3-specific features.</p>\n<p>Currently, the <code>quic</code> module only supports HTTP/3 as a built-in application protocol.\nAll other protocols must be implemented by the user on top of the provided JavaScript\nAPI.</p>",
              "displayName": "Applications"
            },
            {
              "textRaw": "Configuration",
              "name": "configuration",
              "type": "module",
              "desc": "<p>The QUIC API is designed to be flexible and highly configurable to support a wide\nrange of use cases. Users can configure various aspects of the QUIC transport,\nTLS handshake, and application behavior via options passed to the <code>quic.connect()</code>\nand <code>quic.listen()</code> functions, as well as dynamically on <code>QuicEndpoint</code> and\n<code>QuicSession</code> instances. The API also provides access to detailed statistics and\nevents for monitoring and debugging.</p>\n<p>QUIC transport parameters are exchanged during the TLS handshake to negotiate\nvarious transport-level settings such as maximum stream counts, idle timeouts,\nand datagram support. The <code>quic</code> module allows users to configure the transport\nparameters their endpoint advertises to peers, as well as access the transport\nparameters advertised by peers. These configure the capabilities and limits of\nthe QUIC connection in coordination with the peer.</p>\n<p>A rich set of local settings is also available for configuring the behavior of\nthe local endpoint and sessions. These include settings for connection limits,\ncongestion control, stream prioritization, and more.</p>",
              "displayName": "Configuration"
            },
            {
              "textRaw": "Callbacks and Promises",
              "name": "callbacks_and_promises",
              "type": "module",
              "desc": "<p>The <code>quic</code> module uses a combination of callbacks and promises for asynchronous\noperations. For example, initiating a connection with <code>quic.connect()</code> returns\na promise for the established session, while incoming sessions on the server\nside are handled via a callback passed to <code>quic.listen()</code>. Within a session,\nevents such as incoming streams, datagrams, and session state changes are handled\nvia callbacks on the <code>QuicSession</code> instance. Promises are used for operations\nthat have a clear completion point, such as completion of the TLS handshake or\ngraceful closure of a session.</p>\n<p>All callbacks are invoked synchronously and may either return synchronously or\nreturn a promise. If a callback returns a promise that rejects, or throws an error,\nthe object will be destroyed with the error as the reason if an <code>onerror</code> callback\nis not specified.</p>",
              "displayName": "Callbacks and Promises"
            },
            {
              "textRaw": "Streams",
              "name": "streams",
              "type": "module",
              "desc": "<p>Streams are the primary data-carrying abstraction in QUIC. A stream can be\ninitiated by either the local endpoint or the remote peer once a session is\nestablished.</p>\n<p>Streams can be either bidirectional (data flows in both directions) or\nunidirectional (data flows in only one direction). The <code>quic</code> module provides\nseparate APIs for creating each kind:\n<a href=\"#sessioncreatebidirectionalstreamoptions\"><code>session.createBidirectionalStream()</code></a> and\n<a href=\"#sessioncreateunidirectionalstreamoptions\"><code>session.createUnidirectionalStream()</code></a>. Streams initiated by a remote\npeer are delivered via the <a href=\"#sessiononstream\"><code>session.onstream</code></a> callback.</p>\n<p>There are two ways to write data to a stream:</p>\n<ul>\n<li><strong>Body source</strong> — pass a <code>body</code> option when creating the stream (or call\n<a href=\"#streamsetbodybody\"><code>stream.setBody()</code></a>). The body can be a string, <code>ArrayBuffer</code>,\n<code>ArrayBufferView</code>, <code>Blob</code>, <code>FileHandle</code>, <code>AsyncIterable</code>, sync <code>Iterable</code>,\nor <code>Promise</code> resolving to any of these. A <code>null</code> body closes the writable\nside immediately. This is the simplest approach when the data is available\nup front or can be expressed as an iterable.</li>\n<li><strong>Writer</strong> — access <a href=\"#streamwriter\"><code>stream.writer</code></a> to push data incrementally. The\nwriter exposes synchronous methods (<code>writeSync()</code>, <code>writevSync()</code>,\n<code>endSync()</code>) that return immediately, as well as async equivalents\n(<code>write()</code>, <code>writev()</code>, <code>end()</code>) that wait for drain when backpressured.\n<code>writeSync()</code> returns <code>false</code> when the write buffer is full; the caller\nshould wait for drain before retrying.</li>\n</ul>\n<p>These two approaches are mutually exclusive for a given stream.</p>\n<p>Reading is done by iterating the stream as an async iterable. Each iteration\nyields a batch of <code>Uint8Array</code> chunks:</p>\n<pre><code class=\"language-mjs\">for await (const chunks of stream) {\n  for (const chunk of chunks) {\n    // Process each Uint8Array chunk\n  }\n}\n</code></pre>\n<p>Only one async iterator can be obtained per stream. The stream is also\ncompatible with <code>node:stream/iter</code> utilities such as <code>Stream.bytes()</code>,\n<code>Stream.text()</code>, and <code>Stream.pipeTo()</code>.</p>",
              "displayName": "Streams"
            },
            {
              "textRaw": "Datagrams",
              "name": "datagrams",
              "type": "module",
              "desc": "<p>In addition to streams, QUIC supports unreliable datagrams (<a href=\"https://www.rfc-editor.org/rfc/rfc9221\">RFC 9221</a>) for\nuse cases that require low-latency, best-effort messaging.</p>\n<p>Datagram support is enabled at two levels. At the QUIC transport level, both\npeers must advertise a non-zero <a href=\"#transportparamsmaxdatagramframesize\"><code>maxDatagramFrameSize</code></a> transport parameter\nduring the handshake. For HTTP/3 sessions, both peers must additionally set\n<a href=\"#sessionoptionsapplication\"><code>application.enableDatagrams</code></a> to <code>true</code>, which exchanges the\n<code>SETTINGS_H3_DATAGRAM</code> setting on the HTTP/3 control stream.</p>\n<p>A datagram is sent with a single call to <a href=\"#sessionsenddatagramdatagram-encoding\"><code>session.sendDatagram()</code></a>. Each\ndatagram must fit within a single QUIC packet — datagrams cannot be\nfragmented. The maximum payload size is determined by the peer's\n<code>maxDatagramFrameSize</code> and the path MTU. If a datagram is too large or the\npeer does not support datagrams, <code>sendDatagram()</code> returns <code>0n</code> rather than\nthrowing an error.</p>\n<p>There is no guarantee of delivery. Datagrams may be lost, duplicated, or\ndelivered out of order. The <a href=\"#sessionondatagramstatus\"><code>session.ondatagramstatus</code></a> callback reports\nwhether each sent datagram was <code>'acknowledged'</code>, <code>'lost'</code>, or <code>'abandoned'</code>\n(never sent on the wire).</p>",
              "displayName": "Datagrams"
            },
            {
              "textRaw": "0-RTT early data and session resumption",
              "name": "0-rtt_early_data_and_session_resumption",
              "type": "module",
              "desc": "<p>QUIC supports 0-RTT early data, allowing a client that has previously connected\nto a server to send application data with its very first packet, without waiting\nfor the handshake to complete. This can eliminate a full round-trip of latency on\nreconnection.</p>\n<p>Two pieces of state from a prior connection make this possible:</p>\n<ul>\n<li>A <strong>session ticket</strong>, received via the <a href=\"#sessiononsessionticket\"><code>session.onsessionticket</code></a> callback,\nenables TLS session resumption and 0-RTT encryption. Pass it as the\n<a href=\"#sessionoptionssessionticket\"><code>sessionOptions.sessionTicket</code></a> option on a subsequent connection to the\nsame server.</li>\n<li>An <strong>address validation token</strong>, received via the <a href=\"#sessiononnewtoken\"><code>session.onnewtoken</code></a>\ncallback, allows the client to skip the server's address validation step\n(avoiding a Retry round-trip). Pass it as the <a href=\"#sessionoptionstoken-client-only\"><code>sessionOptions.token</code></a>\noption.</li>\n</ul>\n<p>If the server accepts the session ticket, any data sent before the handshake\ncompletes is 0-RTT early data. On the server side, <code>stream.early</code> is <code>true</code>\nfor streams carrying early data. The server can reject the 0-RTT attempt\n(for example, if its configuration has changed since the ticket was issued).\nWhen this happens, all streams opened during the 0-RTT phase are destroyed and\nthe client's <a href=\"#sessiononearlyrejected\"><code>session.onearlyrejected</code></a> callback fires. The connection\nfalls back to a normal 1-RTT handshake and the application can reopen streams.</p>\n<p>Early data is less secure than data sent after the handshake completes — it\ncan potentially be replayed by an attacker. Applications should treat 0-RTT\ndata with appropriate caution and avoid performing non-idempotent operations\nduring the early data phase.</p>",
              "displayName": "0-RTT early data and session resumption"
            },
            {
              "textRaw": "Connection lifecycle",
              "name": "connection_lifecycle",
              "type": "module",
              "desc": "<p>A typical client session progresses through these stages:</p>\n<ol>\n<li>Call <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> with a server address and options. This returns a\n<code>QuicSession</code>.</li>\n<li>The TLS handshake runs automatically. <code>session.opened</code> resolves when the\nhandshake completes, providing the negotiated ALPN, cipher, and certificate\nvalidation results.</li>\n<li>Open streams, send datagrams, and exchange data.</li>\n<li>Call <a href=\"#sessioncloseoptions\"><code>session.close()</code></a> to initiate a graceful shutdown. Existing streams\nare allowed to finish, then the session is destroyed. The returned promise\n(also available as <code>session.closed</code>) resolves when teardown is complete.</li>\n</ol>\n<p>On the server side, call <a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a> with a callback. The callback\nfires for each incoming session after the TLS handshake begins. Incoming\nstreams arrive via the <a href=\"#sessiononstream\"><code>session.onstream</code></a> callback.</p>\n<p><a href=\"#sessiondestroyerror-options\"><code>session.destroy()</code></a> is available for immediate teardown — all open streams\nare destroyed and the session is closed without waiting for them to finish.</p>\n<p><code>QuicEndpoint</code> and <code>QuicSession</code> support <code>Symbol.asyncDispose</code>, so they can\nbe used with <code>await using</code> for automatic cleanup.</p>",
              "displayName": "Connection lifecycle"
            },
            {
              "textRaw": "Error handling",
              "name": "error_handling",
              "type": "module",
              "desc": "<p>Errors in the <code>quic</code> module are communicated through two complementary\nmechanisms: the <code>onerror</code> callback and the <code>closed</code> promise.</p>\n<p>Both <code>QuicSession</code> and <code>QuicStream</code> expose an optional <code>onerror</code> callback.\nWhen a session or stream is destroyed with an error — including errors thrown\nby other user callbacks — the <code>onerror</code> callback is invoked with the error\nbefore the object is torn down. Setting <code>onerror</code> also marks the <code>closed</code>\npromise as handled, preventing unhandled rejection warnings. If <code>onerror</code>\nis not set, the error is delivered solely through the rejection of the\n<code>closed</code> promise.</p>\n<p>The <a href=\"#class-quicerror\"><code>QuicError</code></a> class carries an explicit numeric QUIC error code\n(<a href=\"#errorerrorcode\"><code>error.errorCode</code></a>) alongside the usual <code>message</code> and <code>code</code> properties.\nWhen a <code>QuicError</code> is passed to <a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a> or\n<a href=\"#streamwriter\"><code>writer.fail()</code></a>, its <code>errorCode</code> is used in the <code>RESET_STREAM</code> or\n<code>STOP_SENDING</code> frame sent to the peer. Any other error type falls back to\nthe negotiated protocol's generic internal error code.</p>",
              "displayName": "Error handling"
            },
            {
              "textRaw": "Permission model",
              "name": "permission_model",
              "type": "module",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the <code>--allow-net</code> flag must be passed to\nallow QUIC network operations. Without it, calling <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> or\n<a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a> will throw an <code>ERR_ACCESS_DENIED</code> error.</p>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* --experimental-quic index.mjs\nError: Access to this API has been restricted. Use --allow-net to manage permissions.\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'Net',\n}\n</code></pre>\n<p>Creating a <a href=\"#class-quicendpoint\"><code>QuicEndpoint</code></a> instance without connecting or listening\nis permitted even without <code>--allow-net</code>, since no network I/O occurs until\n<a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> or <a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a> is called.</p>",
              "displayName": "Permission model"
            }
          ],
          "displayName": "Architecture"
        },
        {
          "textRaw": "Types",
          "name": "types",
          "type": "module",
          "modules": [
            {
              "textRaw": "Type: `EndpointOptions`",
              "name": "type:_`endpointoptions`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>The endpoint configuration options passed when constructing a new <code>QuicEndpoint</code> instance.</p>",
              "properties": [
                {
                  "textRaw": "Type: {net.SocketAddress|string} The local UDP address and port the endpoint should bind to.",
                  "name": "address",
                  "type": "net.SocketAddress|string",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>If not specified the endpoint will bind to IPv4 <code>localhost</code> on a random port.</p>",
                  "shortDesc": "The local UDP address and port the endpoint should bind to."
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "addressLRUSize",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The endpoint maintains an internal cache of validated socket addresses as a\nperformance optimization. This option sets the maximum number of addresses\nthat are cached. This is an advanced option that users typically won't have\nneed to specify.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "disableStatelessReset",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code>, the endpoint will not send stateless reset packets in response\nto packets from unknown connections. Stateless resets allow a peer to detect\nthat a connection has been lost even when the server has no state for it.\nDisabling them may be useful in testing or when stateless resets are handled\nat a different layer.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "idleTimeout",
                  "type": "number",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of seconds an endpoint will remain alive after all sessions have\nclosed and it is no longer listening. A value of <code>0</code> (default) means the\nendpoint is only destroyed when explicitly closed via <code>endpoint.close()</code> or\n<code>endpoint.destroy()</code>. A positive value starts an idle timer when the endpoint\nbecomes idle; if no new sessions are created before the timer fires, the\nendpoint is automatically destroyed. This is useful for connection pooling\nwhere endpoints should linger briefly for reuse by future <code>connect()</code> calls.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "ipv6Only",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code>, indicates that the endpoint should bind only to IPv6 addresses.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "maxConnectionsPerHost",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum number of concurrent sessions allowed per remote IP\naddress (ignoring port). When the limit is reached, new connections from the\nsame IP are refused with <code>CONNECTION_REFUSED</code>. A value of <code>0</code> disables the\nlimit. The maximum value is <code>65535</code>.</p>\n<p>This limit can also be changed dynamically after construction via\n<a href=\"#endpointmaxconnectionsperhost\"><code>endpoint.maxConnectionsPerHost</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "maxConnectionsTotal",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum total number of concurrent sessions across all remote\naddresses. When the limit is reached, new connections are refused with\n<code>CONNECTION_REFUSED</code>. A value of <code>0</code> disables the limit. The maximum value is\n<code>65535</code>.</p>\n<p>This limit can also be changed dynamically after construction via\n<a href=\"#endpointmaxconnectionstotal\"><code>endpoint.maxConnectionsTotal</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxRetries",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum number of QUIC retry attempts allowed per remote peer address.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxStatelessResetsPerHost",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum number of stateless resets that are allowed per remote peer address.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "retryTokenExpiration",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the length of time a QUIC retry token is considered valid.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBufferView}",
                  "name": "resetTokenSecret",
                  "type": "ArrayBufferView",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the 16-byte secret used to generate QUIC retry tokens.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "tokenExpiration",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the length of time a QUIC token is considered valid.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBufferView}",
                  "name": "tokenSecret",
                  "type": "ArrayBufferView",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the 16-byte secret used to generate QUIC tokens.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "udpReceiveBufferSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "udpSendBufferSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "udpTTL",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "validateAddress",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code>, requires that the endpoint validate peer addresses using retry packets\nwhile establishing a new connection.</p>"
                }
              ],
              "displayName": "Type: `EndpointOptions`"
            },
            {
              "textRaw": "Type: `SessionOptions`",
              "name": "type:_`sessionoptions`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} (client) | {string[]} (server)",
                  "name": "alpn",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The ALPN (Application-Layer Protocol Negotiation) identifier(s).</p>\n<p>For <strong>client</strong> sessions, this is a single string specifying the protocol\nthe client wants to use (e.g. <code>'h3'</code>).</p>\n<p>For <strong>server</strong> sessions, this is an array of protocol names in preference\norder that the server supports (e.g. <code>['h3', 'h3-29']</code>). During the TLS\nhandshake, the server selects the first protocol from its list that the\nclient also supports.</p>\n<p>The negotiated ALPN determines which Application implementation is used\nfor the session. <code>'h3'</code> and <code>'h3-*'</code> variants select the HTTP/3\napplication; all other values select the default application.</p>\n<p>Default: <code>'h3'</code></p>",
                  "shortDesc": "(client) | {string[]} (server)"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "application",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>HTTP/3 application-specific options. These only apply when the negotiated\nALPN selects the HTTP/3 application (<code>'h3'</code>).</p>\n<ul>\n<li><code>maxHeaderPairs</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of header name-value pairs\naccepted per header block. Headers beyond this limit are silently\ndropped. <strong>Default:</strong> <code>128</code></li>\n<li><code>maxHeaderLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum total byte length of all header\nnames and values combined per header block. Headers that would push\nthe total over this limit are silently dropped. <strong>Default:</strong> <code>8192</code></li>\n<li><code>maxFieldSectionSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum size of a compressed header\nfield section (QPACK). <code>0</code> means unlimited. <strong>Default:</strong> <code>0</code></li>\n<li><code>qpackMaxDTableCapacity</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> QPACK dynamic table capacity in\nbytes. Set to <code>0</code> to disable the dynamic table. <strong>Default:</strong> <code>4096</code></li>\n<li><code>qpackEncoderMaxDTableCapacity</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> QPACK encoder maximum\ndynamic table capacity. <strong>Default:</strong> <code>4096</code></li>\n<li><code>qpackBlockedStreams</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of streams that can\nbe blocked waiting for QPACK dynamic table updates. <strong>Default:</strong> <code>100</code></li>\n<li><code>enableConnectProtocol</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Enable the extended CONNECT\nprotocol (RFC 9220). <strong>Default:</strong> <code>false</code></li>\n<li><code>enableDatagrams</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Enable HTTP/3 datagrams (RFC 9297). <strong>Default:</strong> <code>false</code></li>\n</ul>\n<pre><code class=\"language-mjs\">const { listen } = await import('node:quic');\n\nawait listen((session) => { /* ... */ }, {\n  application: {\n    maxHeaderPairs: 64,\n    qpackMaxDTableCapacity: 8192,\n    enableDatagrams: true,\n  },\n  // ... other session options\n});\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "cc",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the congestion control algorithm that will be used.\nMust be set to one of either <code>'reno'</code>, <code>'cubic'</code>, or <code>'bbr'</code>.</p>\n<p>This is an advanced option that users typically won't have need to specify.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "ciphers",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The list of supported TLS 1.3 cipher algorithms.</p>"
                },
                {
                  "textRaw": "Type: {boolean} **Default:** `true`",
                  "name": "enableEarlyData",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "default": "`true`",
                  "desc": "<p>When <code>true</code>, enables TLS 0-RTT early data for this session. Early data\nallows the client to send application data before the TLS handshake\ncompletes, reducing latency on reconnection when a valid session ticket\nis available. Set to <code>false</code> to disable early data support.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "groups",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The list of supported TLS 1.3 cipher groups.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "keylog",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code>, enables TLS key logging for the session. Key material is\ndelivered to the <a href=\"#sessiononkeylog\"><code>session.onkeylog</code></a> callback in <a href=\"https://udn.realityripple.com/docs/Mozilla/Projects/NSS/Key_Log_Format\">NSS Key Log Format</a>.\nEach callback invocation receives a single line of key material. The output\ncan be used with tools such as Wireshark to decrypt captured QUIC traffic.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxPayloadSize",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum UDP packet payload size.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxStreamWindow",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum stream flow-control window size.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxWindow",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum session flow-control window size.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "minVersion",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The minimum QUIC version number to allow. This is an advanced option that users\ntypically won't have need to specify.</p>"
                },
                {
                  "textRaw": "Type: {string} One of `'use'`, `'ignore'`, or `'default'`.",
                  "name": "preferredAddressPolicy",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When the remote peer advertises a preferred address, this option specifies whether\nto use it or ignore it.</p>",
                  "shortDesc": "One of `'use'`, `'ignore'`, or `'default'`."
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "qlog",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code>, enables <a href=\"https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-main-schema/\">qlog</a> diagnostic output for the session. Qlog data\nis delivered to the <a href=\"#sessiononqlog\"><code>session.onqlog</code></a> callback as chunks of <a href=\"https://www.rfc-editor.org/rfc/rfc7464\">JSON-SEQ</a>\nformatted text. The output can be analyzed with qlog visualization tools\nsuch as <a href=\"https://qvis.quictools.info/\">qvis</a>.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBufferView} A session ticket to use for 0RTT session resumption.",
                  "name": "sessionTicket",
                  "type": "ArrayBufferView",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "A session ticket to use for 0RTT session resumption."
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "datagramDropPolicy",
                  "type": "string",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Controls which datagram to drop when the pending datagram queue\n(sized by <a href=\"#sessionmaxpendingdatagrams\"><code>session.maxPendingDatagrams</code></a>) is full. Must be one of\n<code>'drop-oldest'</code> (discard the oldest queued datagram to make room) or\n<code>'drop-newest'</code> (reject the incoming datagram). Dropped datagrams are\nreported as lost via the <code>ondatagramstatus</code> callback.</p>\n<p>This option is immutable after session creation.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "maxDatagramSendAttempts",
                  "type": "number",
                  "desc": "<p>The maximum number of <code>SendPendingData</code> cycles a datagram can survive\nwithout being sent before it is abandoned. When a datagram cannot be\nsent due to congestion control or packet size constraints, it remains\nin the queue and the attempt counter increments. Once the limit is\nreached, the datagram is dropped and reported as <code>'abandoned'</code> via the\n<code>ondatagramstatus</code> callback. Valid range: <code>1</code> to <code>255</code>.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "drainingPeriodMultiplier",
                  "type": "number",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A multiplier applied to the Probe Timeout (PTO) to compute the draining\nperiod duration after receiving a <code>CONNECTION_CLOSE</code> frame from the peer.\nRFC 9000 Section 10.2 requires the draining period to persist for at least\nthree times the current PTO. The valid range is <code>3</code> to <code>255</code>. Values below\n<code>3</code> are clamped to <code>3</code>.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "handshakeTimeout",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum number of milliseconds a TLS handshake is permitted to take\nto complete before timing out.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "keepAlive",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the keep-alive timeout in milliseconds. When set to a non-zero\nvalue, PING frames will be sent automatically to keep the connection alive\nbefore the idle timeout fires. The value should be less than the effective\nidle timeout (<code>maxIdleTimeout</code> transport parameter) to be useful.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "tlsTrace",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True to enable TLS tracing output.</p>"
                },
                {
                  "textRaw": "Type: {quic.TransportParams}",
                  "name": "transportParams",
                  "type": "quic.TransportParams",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The QUIC transport parameters to use for the session.</p>"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "unacknowledgedPacketThreshold",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Specifies the maximum number of unacknowledged packets a session should allow.</p>"
                },
                {
                  "textRaw": "Type: {boolean} **Default:** `true`",
                  "name": "rejectUnauthorized",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "default": "`true`",
                  "desc": "<p>If <code>true</code>, the peer certificate is verified against the list of supplied CAs.\nAn error is emitted if verification fails; the error can be inspected via\nthe <code>validationErrorReason</code> and <code>validationErrorCode</code> fields in the\nhandshake callback. If <code>false</code>, peer certificate verification errors are\nignored.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "reuseEndpoint",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When <code>true</code> (the default), <code>connect()</code> will attempt to reuse an existing\nendpoint rather than creating a new one for each session. This provides\nconnection pooling behavior — multiple sessions can share a single UDP\nsocket. The reuse logic will not return an endpoint that is listening on\nthe same address as the connect target (to prevent CID routing conflicts).</p>\n<p>Set to <code>false</code> to force creation of a new endpoint for the session. This\nis useful when endpoint isolation is required (e.g., testing stateless\nreset behavior where source port identity matters).</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "verifyClient",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True to require verification of TLS client certificate.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "version",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The QUIC version number to use. This is an advanced option that users typically\nwon't have need to specify.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "`sessionOptions.ca` (client only)",
                  "name": "`sessionoptions.ca`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer[]></code></a></li>\n</ul>\n<p>The CA certificates to use for client sessions. For server sessions, CA\ncertificates are specified per-identity in the <a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map.</p>",
                  "displayName": "`sessionOptions.ca` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.certs` (client only)",
                  "name": "`sessionoptions.certs`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer[]></code></a></li>\n</ul>\n<p>The TLS certificates to use for client sessions. For server sessions,\ncertificates are specified per-identity in the <a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map.</p>",
                  "displayName": "`sessionOptions.certs` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.crl` (client only)",
                  "name": "`sessionoptions.crl`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer[]></code></a></li>\n</ul>\n<p>The CRL to use for client sessions. For server sessions, CRLs are specified\nper-identity in the <a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map.</p>",
                  "displayName": "`sessionOptions.crl` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.keys` (client only)",
                  "name": "`sessionoptions.keys`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v25.9.0",
                          "v24.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/62335",
                        "description": "CryptoKey is no longer accepted."
                      }
                    ]
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> | <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject[]></code></a></li>\n</ul>\n<p>The TLS crypto keys to use for client sessions. For server sessions,\nkeys are specified per-identity in the <a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map.</p>",
                  "displayName": "`sessionOptions.keys` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.servername` (client only)",
                  "name": "`sessionoptions.servername`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>The peer server name to target (SNI). Defaults to <code>'localhost'</code>.</p>",
                  "displayName": "`sessionOptions.servername` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.sni` (server only)",
                  "name": "`sessionoptions.sni`_(server_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>An object mapping host names to TLS identity options for Server Name\nIndication (SNI) support. This is required for server sessions and must\ncontain at least one entry. The special key <code>'*'</code> specifies the optional\ndefault/fallback identity used when no other host name matches. If no\nwildcard entry is provided, connections with unrecognized server names\nwill be rejected with a TLS <code>unrecognized_name</code> alert. Each entry may\ncontain:</p>\n<ul>\n<li><code>keys</code> <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> | <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject[]></code></a> The TLS private keys. <strong>Required.</strong></li>\n<li><code>certs</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer[]></code></a>\nThe TLS certificates. <strong>Required.</strong>\nOptional certificate revocation lists.</li>\n<li><code>verifyPrivateKey</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Verify the private key. Default: <code>false</code>.</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The port to advertise in ORIGIN frames (RFC 9412) for\nthis host name. <strong>Default:</strong> <code>443</code>. Only used for HTTP/3 sessions.</li>\n<li><code>authoritative</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether to include this host name in ORIGIN\nframes. <strong>Default:</strong> <code>true</code>. Set to <code>false</code> to exclude a host name\nfrom ORIGIN advertisements. Wildcard (<code>'*'</code>) entries are always\nexcluded regardless of this setting.</li>\n</ul>\n<pre><code class=\"language-mjs\">const endpoint = await listen(callback, {\n  sni: {\n    '*': { keys: [defaultKey], certs: [defaultCert] },\n    'api.example.com': { keys: [apiKey], certs: [apiCert], port: 8443 },\n    'www.example.com': { keys: [wwwKey], certs: [wwwCert], ca: [customCA] },\n    'internal.example.com': { keys: [intKey], certs: [intCert], authoritative: false },\n  },\n});\n</code></pre>\n<p>Shared TLS options (such as <code>ciphers</code>, <code>groups</code>, <code>keylog</code>, and <code>verifyClient</code>)\nare specified at the top level of the session options and apply to all\nidentities. Each SNI entry overrides only the per-identity certificate\nfields.</p>\n<p>The SNI map can be replaced at runtime using <code>endpoint.setSNIContexts()</code>,\nwhich atomically swaps the map for new sessions while existing sessions\ncontinue to use their original identity.</p>",
                  "displayName": "`sessionOptions.sni` (server only)"
                },
                {
                  "textRaw": "`sessionOptions.token` (client only)",
                  "name": "`sessionoptions.token`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "REPLACEME"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: {ArrayBufferView}</li>\n</ul>\n<p>An opaque address validation token previously received from the server\nvia the <a href=\"#sessiononnewtoken\"><code>session.onnewtoken</code></a> callback. Providing a valid token on\nreconnection allows the client to skip the server's address validation,\nreducing handshake latency.</p>",
                  "displayName": "`sessionOptions.token` (client only)"
                },
                {
                  "textRaw": "`sessionOptions.verifyPrivateKey` (client only)",
                  "name": "`sessionoptions.verifyprivatekey`_(client_only)",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>\n<p>True to require private key verification for client sessions. For server\nsessions, this option is specified per-identity in the\n<a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map.</p>",
                  "displayName": "`sessionOptions.verifyPrivateKey` (client only)"
                }
              ],
              "displayName": "Type: `SessionOptions`"
            },
            {
              "textRaw": "Type: `TransportParams`",
              "name": "type:_`transportparams`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {net.SocketAddress} The preferred IPv4 address to advertise (only used by servers).",
                  "name": "preferredAddressIpv4",
                  "type": "net.SocketAddress",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "The preferred IPv4 address to advertise (only used by servers)."
                },
                {
                  "textRaw": "Type: {net.SocketAddress} The preferred IPv6 address to advertise (only used by servers)",
                  "name": "preferredAddressIpv6",
                  "type": "net.SocketAddress",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "The preferred IPv6 address to advertise (only used by servers)"
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxStreamDataBidiLocal",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxStreamDataBidiRemote",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxStreamDataUni",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxData",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxStreamsBidi",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "initialMaxStreamsUni",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxIdleTimeout",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "activeConnectionIDLimit",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "ackDelayExponent",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxAckDelay",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {bigint|number}",
                  "name": "maxDatagramFrameSize",
                  "type": "bigint|number",
                  "meta": {
                    "added": [
                      "v23.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The maximum size in bytes of a DATAGRAM frame payload that this endpoint\nis willing to receive. Set to <code>0</code> to disable datagram support. The peer\nwill not send datagrams larger than this value. The actual maximum size of\na datagram that can be <em>sent</em> is determined by the peer's\n<code>maxDatagramFrameSize</code>, not this endpoint's value.</p>"
                }
              ],
              "displayName": "Type: `TransportParams`"
            }
          ],
          "displayName": "Types"
        },
        {
          "textRaw": "Callbacks",
          "name": "callbacks",
          "type": "module",
          "modules": [
            {
              "textRaw": "Callback error handling",
              "name": "callback_error_handling",
              "type": "module",
              "desc": "<p>All session and stream callbacks may be synchronous functions or async\nfunctions. If a callback throws synchronously or returns a promise that\nrejects, the error is caught and the owning session or stream is destroyed\nwith that error:</p>\n<ul>\n<li>Stream callbacks (<code>onblocked</code>, <code>onreset</code>, <code>onheaders</code>, <code>ontrailers</code>,\n<code>oninfo</code>, <code>onwanttrailers</code>): the stream is destroyed.</li>\n<li>Session callbacks (<code>onstream</code>, <code>ondatagram</code>, <code>ondatagramstatus</code>,\n<code>onpathvalidation</code>, <code>onsessionticket</code>, <code>onnewtoken</code>,\n<code>onversionnegotiation</code>, <code>onorigin</code>, <code>ongoaway</code>, <code>onhandshake</code>,\n<code>onkeylog</code>, <code>onqlog</code>): the session is destroyed along with all of its\nstreams.</li>\n</ul>\n<p>Before destruction, the optional <a href=\"#sessiononerror\"><code>session.onerror</code></a> or\n<a href=\"#streamonerror\"><code>stream.onerror</code></a> callback is invoked (if set), giving the application a\nchance to observe or log the error. The <code>session.closed</code> or <code>stream.closed</code>\npromise will reject with the error.</p>\n<p>If the <code>onerror</code> callback itself throws or returns a promise that rejects,\nthe error from <code>onerror</code> is surfaced as an uncaught exception.</p>",
              "displayName": "Callback error handling"
            },
            {
              "textRaw": "Callback: `OnSessionCallback`",
              "name": "callback:_`onsessioncallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>The callback function that is invoked when a new session is initiated by a remote peer.</p>",
              "displayName": "Callback: `OnSessionCallback`"
            },
            {
              "textRaw": "Callback: `OnStreamCallback`",
              "name": "callback:_`onstreamcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n</ul>",
              "displayName": "Callback: `OnStreamCallback`"
            },
            {
              "textRaw": "Callback: `OnDatagramCallback`",
              "name": "callback:_`ondatagramcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>datagram</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a></li>\n<li><code>early</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>",
              "displayName": "Callback: `OnDatagramCallback`"
            },
            {
              "textRaw": "Callback: `OnDatagramStatusCallback`",
              "name": "callback:_`ondatagramstatuscallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a></li>\n<li><code>status</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of <code>'acknowledged'</code>, <code>'lost'</code>, or <code>'abandoned'</code>.\n<code>'acknowledged'</code> means the peer confirmed receipt. <code>'lost'</code> means the\ndatagram was sent but the network lost it. <code>'abandoned'</code> means the\ndatagram was never sent on the wire (dropped due to queue overflow,\nsend attempt limit exceeded, or frame size rejection).</li>\n</ul>",
              "displayName": "Callback: `OnDatagramStatusCallback`"
            },
            {
              "textRaw": "Callback: `OnPathValidationCallback`",
              "name": "callback:_`onpathvalidationcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>result</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of either <code>'success'</code>, <code>'failure'</code>, or <code>'aborted'</code>.</li>\n<li><code>newLocalAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The local address of the validated path.</li>\n<li><code>newRemoteAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The remote address of the validated path.</li>\n<li><code>oldLocalAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The local address of the previous\npath, or <code>null</code> if this is the first path validation (e.g., preferred address\nmigration from the client's perspective).</li>\n<li><code>oldRemoteAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The remote address of the previous\npath, or <code>null</code>.</li>\n<li><code>preferredAddress</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <code>true</code> if the path validation was triggered by\na preferred address migration on the client side. <code>undefined</code> on the server side.</li>\n</ul>",
              "displayName": "Callback: `OnPathValidationCallback`"
            },
            {
              "textRaw": "Callback: `OnSessionTicketCallback`",
              "name": "callback:_`onsessionticketcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>ticket</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>",
              "displayName": "Callback: `OnSessionTicketCallback`"
            },
            {
              "textRaw": "Callback: `OnVersionNegotiationCallback`",
              "name": "callback:_`onversionnegotiationcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>version</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The QUIC version that was configured for this session\n(the version that the server did not support).</li>\n<li><code>requestedVersions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number[]></code></a> The versions advertised by the server in\nthe Version Negotiation packet. These are the versions the server supports.</li>\n<li><code>supportedVersions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number[]></code></a> The versions supported locally, expressed\nas a two-element array <code>[minVersion, maxVersion]</code>.</li>\n</ul>\n<p>Called when the server responds to the client's Initial packet with a\nVersion Negotiation packet, indicating that the version used by the client\nis not supported. The session is always destroyed immediately after this\ncallback returns.</p>",
              "displayName": "Callback: `OnVersionNegotiationCallback`"
            },
            {
              "textRaw": "Callback: `OnHandshakeCallback`",
              "name": "callback:_`onhandshakecallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The same object that <code>session.opened</code> resolves with.\n<ul>\n<li><code>local</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The local socket address.</li>\n<li><code>remote</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The remote socket address.</li>\n<li><code>servername</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The SNI server name negotiated during the handshake.</li>\n<li><code>protocol</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The ALPN protocol negotiated during the handshake.</li>\n<li><code>cipher</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the negotiated TLS cipher suite.</li>\n<li><code>cipherVersion</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The TLS protocol version of the cipher suite.</li>\n<li><code>validationErrorReason</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If certificate validation failed, the\nreason string. Empty string if validation succeeded.</li>\n<li><code>validationErrorCode</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> If certificate validation failed, the\nerror code. <code>0</code> if validation succeeded.</li>\n<li><code>earlyDataAttempted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether 0-RTT early data was attempted.</li>\n<li><code>earlyDataAccepted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether 0-RTT early data was accepted.</li>\n</ul>\n</li>\n</ul>",
              "displayName": "Callback: `OnHandshakeCallback`"
            },
            {
              "textRaw": "Callback: `OnNewTokenCallback`",
              "name": "callback:_`onnewtokencallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>token</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The NEW_TOKEN token data.</li>\n<li><code>address</code> {SocketAddress} The remote address the token is associated with.</li>\n</ul>",
              "displayName": "Callback: `OnNewTokenCallback`"
            },
            {
              "textRaw": "Callback: `OnOriginCallback`",
              "name": "callback:_`onorigincallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>origins</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> The list of origins the server is authoritative for.</li>\n</ul>",
              "displayName": "Callback: `OnOriginCallback`"
            },
            {
              "textRaw": "Callback: `OnKeylogCallback`",
              "name": "callback:_`onkeylogcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>line</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A single line of <a href=\"https://udn.realityripple.com/docs/Mozilla/Projects/NSS/Key_Log_Format\">NSS Key Log Format</a> text, including\na trailing newline character.</li>\n</ul>\n<p>Called when TLS key material is available. Only fires when\n<a href=\"#sessionoptionskeylog\"><code>sessionOptions.keylog</code></a> is <code>true</code>. Multiple lines are emitted during the\nTLS 1.3 handshake, each containing a secret label, the client random, and\nthe secret value.</p>",
              "displayName": "Callback: `OnKeylogCallback`"
            },
            {
              "textRaw": "Callback: `OnQlogCallback`",
              "name": "callback:_`onqlogcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>data</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A chunk of <a href=\"https://www.rfc-editor.org/rfc/rfc7464\">JSON-SEQ</a> formatted <a href=\"https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-main-schema/\">qlog</a> data.</li>\n<li><code>fin</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <code>true</code> if this is the final qlog chunk for the session.</li>\n</ul>\n<p>Called when qlog diagnostic data is available. Only fires when\n<a href=\"#sessionoptionsqlog\"><code>sessionOptions.qlog</code></a> is <code>true</code>. The <code>data</code> chunks should be\nconcatenated in order to produce the complete qlog output. When <code>fin</code> is\n<code>true</code>, no more chunks will be emitted and the concatenated result is a\ncomplete JSON-SEQ document.</p>",
              "displayName": "Callback: `OnQlogCallback`"
            },
            {
              "textRaw": "Callback: `OnBlockedCallback`",
              "name": "callback:_`onblockedcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n</ul>",
              "displayName": "Callback: `OnBlockedCallback`"
            },
            {
              "textRaw": "Callback: `OnStreamErrorCallback`",
              "name": "callback:_`onstreamerrorcallback`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a></li>\n</ul>",
              "displayName": "Callback: `OnStreamErrorCallback`"
            },
            {
              "textRaw": "Callback: `OnHeadersCallback`",
              "name": "callback:_`onheaderscallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>headers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Header object with lowercase string keys and\nstring or string-array values.</li>\n</ul>\n<p>Called when initial request or response headers are received. For HTTP/3,\nthis delivers request pseudo-headers on the server and response headers\non the client.</p>",
              "displayName": "Callback: `OnHeadersCallback`"
            },
            {
              "textRaw": "Callback: `OnTrailersCallback`",
              "name": "callback:_`ontrailerscallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>trailers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Trailing header object.</li>\n</ul>\n<p>Called when trailing headers are received from the peer.</p>",
              "displayName": "Callback: `OnTrailersCallback`"
            },
            {
              "textRaw": "Callback: `OnInfoCallback`",
              "name": "callback:_`oninfocallback`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>this</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>headers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Informational header object.</li>\n</ul>\n<p>Called when informational (1xx) headers are received from the server\n(e.g., 103 Early Hints).</p>",
              "displayName": "Callback: `OnInfoCallback`"
            }
          ],
          "displayName": "Callbacks"
        },
        {
          "textRaw": "HTTP/3 support",
          "name": "http/3_support",
          "type": "module",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>When the negotiated ALPN identifier is <code>'h3'</code> (or one of the <code>'h3-*'</code>\ndraft variants), the QUIC session runs the HTTP/3 application backed\nby <code>nghttp3</code>. <code>'h3'</code> is the default ALPN for <code>quic.connect()</code> and\n<code>quic.listen()</code>, so HTTP/3 is what you get unless you select a\ndifferent ALPN explicitly.</p>\n<p>Selecting the HTTP/3 application enables a number of stream- and\nsession-level capabilities that are not available to non-HTTP/3\napplications:</p>\n<ul>\n<li><strong>Headers and trailers</strong> — request and response header blocks\n(including pseudo-headers such as <code>:method</code>, <code>:path</code>, <code>:scheme</code>,\n<code>:authority</code>, and <code>:status</code>), trailing headers, and informational\n(<code>1xx</code>) responses. See <a href=\"#streamsendheadersheaders-options\"><code>stream.sendHeaders()</code></a>,\n<a href=\"#streamsendtrailersheaders\"><code>stream.sendTrailers()</code></a>, and\n<a href=\"#streamsendinformationalheadersheaders\"><code>stream.sendInformationalHeaders()</code></a>.</li>\n<li><strong>Stream priority (RFC 9218)</strong> — per-stream urgency and\nincremental flags. See <a href=\"#streampriority\"><code>stream.priority</code></a> and\n<a href=\"#streamsetpriorityoptions\"><code>stream.setPriority()</code></a>.</li>\n<li><strong>HTTP/3 datagrams (RFC 9297)</strong> — unreliable application-layer\ndatagrams. The peer must advertise <code>SETTINGS_H3_DATAGRAM=1</code>, which\nis enabled by setting <a href=\"#sessionoptionsapplication\"><code>application.enableDatagrams</code></a> to <code>true</code>\non both peers. See <a href=\"#sessionsenddatagramdatagram-encoding\"><code>session.sendDatagram()</code></a> and\n<a href=\"#sessionondatagram\"><code>session.ondatagram</code></a>.</li>\n<li><strong>ORIGIN frame (RFC 9412)</strong> — servers automatically advertise the\nhostnames in their <a href=\"#sessionoptionssni-server-only\"><code>sessionOptions.sni</code></a> map (entries with\n<code>authoritative: true</code>); clients receive the list via\n<a href=\"#sessiononorigin\"><code>session.onorigin</code></a>.</li>\n<li><strong>GOAWAY</strong> — graceful shutdown. The server emits <code>GOAWAY</code> as part\nof <a href=\"#sessioncloseoptions\"><code>session.close()</code></a>; the client observes it via\n<a href=\"#sessionongoaway\"><code>session.ongoaway</code></a> and stops opening new bidirectional streams.</li>\n<li><strong>Extended CONNECT settings (RFC 9220)</strong> — the\n<code>SETTINGS_ENABLE_CONNECT_PROTOCOL</code> setting can be enabled via\n<a href=\"#sessionoptionsapplication\"><code>application.enableConnectProtocol</code></a>. The setting is exchanged\nbut the application is responsible for handling the <code>:protocol</code>\npseudo-header and any payload framing on top.</li>\n<li><strong>QPACK tuning</strong> — dynamic-table size and blocked-streams limits\nvia <a href=\"#sessionoptionsapplication\"><code>application.qpackMaxDTableCapacity</code></a> and friends.</li>\n</ul>",
          "modules": [
            {
              "textRaw": "Minimal HTTP/3 client",
              "name": "minimal_http/3_client",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { connect } from 'node:quic';\nimport process from 'node:process';\n\nconst session = await connect('example.com:443', {\n  // ALPN defaults to 'h3'.\n  servername: 'example.com',\n});\nawait session.opened;\n\nconst stream = await session.createBidirectionalStream({\n  headers: {\n    ':method': 'GET',\n    ':path': '/',\n    ':scheme': 'https',\n    ':authority': 'example.com',\n  },\n  onheaders(headers) {\n    console.log('status:', headers[':status']);\n  },\n});\n\nconst decoder = new TextDecoder();\nfor await (const chunks of stream) {\n  for (const chunk of chunks) {\n    process.stdout.write(decoder.decode(chunk, { stream: true }));\n  }\n}\n\nawait session.close();\n</code></pre>\n<p>A few things to note:</p>\n<ul>\n<li><code>session.createBidirectionalStream({ headers })</code> automatically\nmarks the HEADERS frame as terminal when no <code>body</code> is provided —\nthe request is <code>HEADERS</code> followed by <code>END_STREAM</code>.</li>\n<li>The <code>onheaders</code> callback receives the response pseudo-headers and\nregular headers in a single object with lowercase string keys.\nAfter the callback returns, the same object is also accessible\nvia <a href=\"#streamheaders\"><code>stream.headers</code></a>.</li>\n<li>Reading <code>for await (const chunks of stream)</code> consumes the response\nbody. Each iteration yields a <code>Uint8Array[]</code> batch of chunks.</li>\n<li>HTTP semantic helpers (URL parsing, method/status validation,\nredirects, content negotiation, and so on) are intentionally not\nbuilt in. The caller is responsible for any HTTP-level handling\nbeyond the wire framing.</li>\n</ul>",
              "displayName": "Minimal HTTP/3 client"
            },
            {
              "textRaw": "Minimal HTTP/3 server",
              "name": "minimal_http/3_server",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { listen } from 'node:quic';\n\nconst encoder = new TextEncoder();\n\nconst endpoint = await listen((session) => {\n  // The session.onstream callback fires for each new client-initiated stream.\n}, {\n  sni: { '*': { keys: [defaultKey], certs: [defaultCert] } },\n  // ALPN defaults to 'h3'.\n  onheaders(headers) {\n    // `this` is the QuicStream. Pseudo-headers are available on the\n    // request header block (`:method`, `:path`, `:scheme`,\n    // `:authority`).\n    if (headers[':path'] === '/health') {\n      this.sendHeaders({ ':status': '200', 'content-type': 'text/plain' });\n      const w = this.writer;\n      w.writeSync(encoder.encode('ok\\n'));\n      w.endSync();\n    } else {\n      this.sendHeaders({ ':status': '404' }, { terminal: true });\n    }\n  },\n});\n\nconsole.log('listening on', endpoint.address);\n</code></pre>\n<p>Server-side notes:</p>\n<ul>\n<li>Setting <code>onheaders</code> at the <a href=\"#quiclistenonsession-options\"><code>listen()</code></a> level\napplies it to every incoming stream (it is wired up before\n<code>onstream</code> fires). Setting it inside <code>onstream</code> is too late for\nHTTP/3, where the request HEADERS frame is the first thing that\narrives on the stream.</li>\n<li><code>this.sendHeaders(headers, { terminal: true })</code> marks the\nresponse HEADERS frame as terminal (no body follows).</li>\n<li>For body responses, send headers first, then write to\n<code>this.writer</code> and call <code>endSync()</code> to send the body and close the\nstream cleanly.</li>\n</ul>",
              "displayName": "Minimal HTTP/3 server"
            },
            {
              "textRaw": "What is not implemented",
              "name": "what_is_not_implemented",
              "type": "module",
              "desc": "<ul>\n<li><strong>Server push</strong> — <code>PUSH_PROMISE</code> and the related push-stream\nmachinery are not implemented and are not on the near-term\nroadmap. Server push has limited deployment in practice, and most\nuse cases are better served by Early Hints (<code>103</code>) or by direct\nfetches from the client.</li>\n<li><strong>WebTransport / extended-CONNECT helpers</strong> — the\n<code>SETTINGS_ENABLE_CONNECT_PROTOCOL</code> setting can be negotiated but\nthere is no built-in support for the <code>:protocol</code> pseudo-header,\nWebTransport datagram demultiplexing, or capsule framing.</li>\n<li><strong>Higher-level HTTP semantics</strong> — there is no built-in\nrequest/response router, URL parsing, content-encoding\nnegotiation, body-type coercion, redirect following, or\ncookie handling. These are deliberately left to higher-level\nlibraries built on top of <code>node:quic</code>.</li>\n</ul>",
              "displayName": "What is not implemented"
            }
          ],
          "displayName": "HTTP/3 support"
        },
        {
          "textRaw": "Performance measurement",
          "name": "performance_measurement",
          "type": "module",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>QUIC sessions, streams, and endpoints emit <a href=\"perf_hooks.html#class-performanceentry\"><code>PerformanceEntry</code></a> objects\nwith <code>entryType</code> set to <code>'quic'</code>. These entries are only created when a\n<a href=\"perf_hooks.html#class-performanceobserver\"><code>PerformanceObserver</code></a> is observing the <code>'quic'</code> entry type, ensuring\nzero overhead when not in use.</p>\n<p>Each entry provides:</p>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of <code>'QuicEndpoint'</code>, <code>'QuicSession'</code>, or <code>'QuicStream'</code>.</li>\n<li><code>entryType</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Always <code>'quic'</code>.</li>\n<li><code>startTime</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> High-resolution timestamp (ms) when the object was created.</li>\n<li><code>duration</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Lifetime in milliseconds from creation to destruction.</li>\n<li><code>detail</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Entry-specific metadata (see below).</li>\n</ul>",
          "modules": [
            {
              "textRaw": "`QuicEndpoint` entries",
              "name": "`quicendpoint`_entries",
              "type": "module",
              "desc": "<ul>\n<li><code>detail.stats</code> {QuicEndpointStats} The endpoint's statistics object\n(frozen at destruction time).</li>\n</ul>",
              "displayName": "`QuicEndpoint` entries"
            },
            {
              "textRaw": "`QuicSession` entries",
              "name": "`quicsession`_entries",
              "type": "module",
              "desc": "<ul>\n<li><code>detail.stats</code> {QuicSessionStats} The session's statistics object\n(frozen at destruction time). Includes bytes sent/received, RTT\nmeasurements, congestion window, packet counts, and more.</li>\n<li><code>detail.handshake</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> Timing-relevant handshake metadata,\nor <code>undefined</code> if the handshake did not complete before destruction.\n<ul>\n<li><code>servername</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The negotiated SNI server name.</li>\n<li><code>protocol</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The negotiated ALPN protocol.</li>\n<li><code>earlyDataAttempted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether 0-RTT early data was attempted.</li>\n<li><code>earlyDataAccepted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether 0-RTT early data was accepted.</li>\n</ul>\n</li>\n<li><code>detail.path</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The session's network path, or <code>undefined</code> if not yet established.\n<ul>\n<li><code>local</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a></li>\n<li><code>remote</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a></li>\n</ul>\n</li>\n</ul>",
              "displayName": "`QuicSession` entries"
            },
            {
              "textRaw": "`QuicStream` entries",
              "name": "`quicstream`_entries",
              "type": "module",
              "desc": "<ul>\n<li><code>detail.stats</code> {QuicStreamStats} The stream's statistics object\n(frozen at destruction time). Includes bytes sent/received, timing\ntimestamps, and offset tracking.</li>\n<li><code>detail.direction</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'bidi'</code> or <code>'uni'</code>.</li>\n</ul>",
              "displayName": "`QuicStream` entries"
            },
            {
              "textRaw": "Example",
              "name": "example",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((list) => {\n  for (const entry of list.getEntries()) {\n    console.log(`${entry.name}: ${entry.duration.toFixed(1)}ms`);\n    if (entry.name === 'QuicSession') {\n      const { stats, handshake } = entry.detail;\n      console.log(`  protocol: ${handshake?.protocol}`);\n      console.log(`  bytes sent: ${stats.bytesSent}`);\n      console.log(`  smoothed RTT: ${stats.smoothedRtt}ns`);\n    }\n  }\n});\nobs.observe({ entryTypes: ['quic'] });\n</code></pre>",
              "displayName": "Example"
            }
          ],
          "displayName": "Performance measurement"
        },
        {
          "textRaw": "Diagnostic Channels",
          "name": "diagnostic_channels",
          "type": "module",
          "modules": [
            {
              "textRaw": "Channel: `quic.endpoint.created`",
              "name": "channel:_`quic.endpoint.created`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>config</code> <a href=\"quic.html#class-quicendpointoptions\"><code>&#x3C;quic.EndpointOptions></code></a></li>\n</ul>\n<p>Published when a new endpoint is created.</p>",
              "displayName": "Channel: `quic.endpoint.created`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.listen`",
              "name": "channel:_`quic.endpoint.listen`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>options</code> <a href=\"quic.html#class-quicsessionoptions\"><code>&#x3C;quic.SessionOptions></code></a></li>\n</ul>\n<p>Published when an endpoint begins listening for incoming connections.</p>",
              "displayName": "Channel: `quic.endpoint.listen`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.connect`",
              "name": "channel:_`quic.endpoint.connect`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>address</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The target server address.</li>\n<li><code>options</code> <a href=\"quic.html#class-quicsessionoptions\"><code>&#x3C;quic.SessionOptions></code></a></li>\n</ul>\n<p>Published when <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> is about to create a client session.\nFires before the ngtcp2 connection is established, allowing diagnostic\nsubscribers to observe the connection intent.</p>",
              "displayName": "Channel: `quic.endpoint.connect`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.closing`",
              "name": "channel:_`quic.endpoint.closing`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>hasPendingError</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>\n<p>Published when an endpoint begins gracefully closing.</p>",
              "displayName": "Channel: `quic.endpoint.closing`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.closed`",
              "name": "channel:_`quic.endpoint.closed`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>stats</code> <a href=\"quic.html#class-quicquicendpointstats\"><code>&#x3C;quic.QuicEndpoint.Stats></code></a> Final endpoint statistics.</li>\n</ul>\n<p>Published when an endpoint has finished closing and is destroyed.</p>",
              "displayName": "Channel: `quic.endpoint.closed`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.error`",
              "name": "channel:_`quic.endpoint.error`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a></li>\n</ul>\n<p>Published when an endpoint encounters an error that causes it to close.</p>",
              "displayName": "Channel: `quic.endpoint.error`"
            },
            {
              "textRaw": "Channel: `quic.endpoint.busy.change`",
              "name": "channel:_`quic.endpoint.busy.change`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>busy</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>\n<p>Published when an endpoint's busy state changes.</p>",
              "displayName": "Channel: `quic.endpoint.busy.change`"
            },
            {
              "textRaw": "Channel: `quic.session.created.client`",
              "name": "channel:_`quic.session.created.client`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>address</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The remote server address.</li>\n<li><code>options</code> <a href=\"quic.html#class-quicsessionoptions\"><code>&#x3C;quic.SessionOptions></code></a></li>\n</ul>\n<p>Published when a client-initiated session is created.</p>",
              "displayName": "Channel: `quic.session.created.client`"
            },
            {
              "textRaw": "Channel: `quic.session.created.server`",
              "name": "channel:_`quic.session.created.server`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>endpoint</code> <a href=\"quic.html#class-quicquicendpoint\"><code>&#x3C;quic.QuicEndpoint></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>address</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The remote peer address.</li>\n</ul>\n<p>Published when a server-side session is created for an incoming connection.</p>",
              "displayName": "Channel: `quic.session.created.server`"
            },
            {
              "textRaw": "Channel: `quic.session.open.stream`",
              "name": "channel:_`quic.session.open.stream`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>direction</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'bidi'</code> or <code>'uni'</code>.</li>\n</ul>\n<p>Published when a locally-initiated stream is opened.</p>",
              "displayName": "Channel: `quic.session.open.stream`"
            },
            {
              "textRaw": "Channel: `quic.session.received.stream`",
              "name": "channel:_`quic.session.received.stream`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>direction</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'bidi'</code> or <code>'uni'</code>.</li>\n</ul>\n<p>Published when a remotely-initiated stream is received.</p>",
              "displayName": "Channel: `quic.session.received.stream`"
            },
            {
              "textRaw": "Channel: `quic.session.send.datagram`",
              "name": "channel:_`quic.session.send.datagram`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a> The datagram ID.</li>\n<li><code>length</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The datagram payload size in bytes.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a datagram is queued for sending.</p>",
              "displayName": "Channel: `quic.session.send.datagram`"
            },
            {
              "textRaw": "Channel: `quic.session.update.key`",
              "name": "channel:_`quic.session.update.key`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a TLS key update is initiated.</p>",
              "displayName": "Channel: `quic.session.update.key`"
            },
            {
              "textRaw": "Channel: `quic.session.closing`",
              "name": "channel:_`quic.session.closing`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a session begins gracefully closing (including when a\nGOAWAY frame is received from the peer).</p>",
              "displayName": "Channel: `quic.session.closing`"
            },
            {
              "textRaw": "Channel: `quic.session.closed`",
              "name": "channel:_`quic.session.closed`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The error that caused the close, or <code>undefined</code> if clean.</li>\n<li><code>stats</code> <a href=\"quic.html#class-quicquicsessionstats\"><code>&#x3C;quic.QuicSession.Stats></code></a> Final session statistics.</li>\n</ul>\n<p>Published when a session is destroyed. The <code>stats</code> object is a snapshot\nof the final statistics at the time of destruction.</p>",
              "displayName": "Channel: `quic.session.closed`"
            },
            {
              "textRaw": "Channel: `quic.session.error`",
              "name": "channel:_`quic.session.error`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The error that caused the session to be destroyed.</li>\n</ul>\n<p>Published when a session is destroyed due to an error. Fires before the\n<code>onerror</code> callback and before streams are torn down. Unlike\n<code>quic.session.closed</code> (which fires for both clean and error closes), this\nchannel fires only when an error is present, making it suitable for\nerror-only alerting.</p>",
              "displayName": "Channel: `quic.session.error`"
            },
            {
              "textRaw": "Channel: `quic.session.receive.datagram`",
              "name": "channel:_`quic.session.receive.datagram`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>length</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The datagram payload size in bytes.</li>\n<li><code>early</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Whether the datagram was received as 0-RTT early data.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a datagram is received from the remote peer.</p>",
              "displayName": "Channel: `quic.session.receive.datagram`"
            },
            {
              "textRaw": "Channel: `quic.session.receive.datagram.status`",
              "name": "channel:_`quic.session.receive.datagram.status`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a> The datagram ID.</li>\n<li><code>status</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of <code>'acknowledged'</code>, <code>'lost'</code>, or <code>'abandoned'</code>.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when the delivery status of a sent datagram is updated.</p>",
              "displayName": "Channel: `quic.session.receive.datagram.status`"
            },
            {
              "textRaw": "Channel: `quic.session.path.validation`",
              "name": "channel:_`quic.session.path.validation`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>result</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of <code>'success'</code>, <code>'failure'</code>, or <code>'aborted'</code>.</li>\n<li><code>newLocalAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a></li>\n<li><code>newRemoteAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a></li>\n<li><code>oldLocalAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></li>\n<li><code>oldRemoteAddress</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></li>\n<li><code>preferredAddress</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a path validation attempt completes.</p>",
              "displayName": "Channel: `quic.session.path.validation`"
            },
            {
              "textRaw": "Channel: `quic.session.new.token`",
              "name": "channel:_`quic.session.new.token`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>token</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The NEW_TOKEN token data.</li>\n<li><code>address</code> <a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a> The remote server address.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a client session receives a NEW_TOKEN frame from the\nserver.</p>",
              "displayName": "Channel: `quic.session.new.token`"
            },
            {
              "textRaw": "Channel: `quic.session.ticket`",
              "name": "channel:_`quic.session.ticket`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>ticket</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The opaque session ticket.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a new TLS session ticket is received.</p>",
              "displayName": "Channel: `quic.session.ticket`"
            },
            {
              "textRaw": "Channel: `quic.session.version.negotiation`",
              "name": "channel:_`quic.session.version.negotiation`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>version</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The QUIC version that was configured for this session.</li>\n<li><code>requestedVersions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number[]></code></a> The versions advertised by the server.</li>\n<li><code>supportedVersions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number[]></code></a> The versions supported locally.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when the client receives a Version Negotiation packet from the\nserver. The session is always destroyed immediately after.</p>",
              "displayName": "Channel: `quic.session.version.negotiation`"
            },
            {
              "textRaw": "Channel: `quic.session.receive.origin`",
              "name": "channel:_`quic.session.receive.origin`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>origins</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> The list of origins the server is authoritative for.</li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when the session receives an ORIGIN frame (RFC 9412) from\nthe peer.</p>",
              "displayName": "Channel: `quic.session.receive.origin`"
            },
            {
              "textRaw": "Channel: `quic.session.handshake`",
              "name": "channel:_`quic.session.handshake`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>servername</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>protocol</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>cipher</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>cipherVersion</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>validationErrorReason</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>validationErrorCode</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>earlyDataAttempted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>earlyDataAccepted</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>\n<p>Published when the TLS handshake completes.</p>",
              "displayName": "Channel: `quic.session.handshake`"
            },
            {
              "textRaw": "Channel: `quic.session.goaway`",
              "name": "channel:_`quic.session.goaway`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>lastStreamId</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a> The highest stream ID the peer may have processed.</li>\n</ul>\n<p>Published when the peer sends an HTTP/3 GOAWAY frame. Streams with IDs\nabove <code>lastStreamId</code> were not processed and can be retried on a new\nconnection. A <code>lastStreamId</code> of <code>-1n</code> indicates a shutdown notice without\na stream boundary.</p>",
              "displayName": "Channel: `quic.session.goaway`"
            },
            {
              "textRaw": "Channel: `quic.session.early.rejected`",
              "name": "channel:_`quic.session.early.rejected`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when the server rejects 0-RTT early data. All streams that were\nopened during the 0-RTT phase have been destroyed. Useful for diagnosing\nlatency regressions when 0-RTT is expected to succeed.</p>",
              "displayName": "Channel: `quic.session.early.rejected`"
            },
            {
              "textRaw": "Channel: `quic.stream.closed`",
              "name": "channel:_`quic.stream.closed`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The error that caused the close, or <code>undefined</code> if clean.</li>\n<li><code>stats</code> <a href=\"quic.html#class-quicquicstreamstats\"><code>&#x3C;quic.QuicStream.Stats></code></a> Final stream statistics.</li>\n</ul>\n<p>Published when a stream is destroyed. The <code>stats</code> object is a snapshot\nof the final statistics at the time of destruction.</p>",
              "displayName": "Channel: `quic.stream.closed`"
            },
            {
              "textRaw": "Channel: `quic.stream.headers`",
              "name": "channel:_`quic.stream.headers`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>headers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The initial request or response headers.</li>\n</ul>\n<p>Published when initial headers are received on a stream. For HTTP/3\nserver-side streams, this contains request pseudo-headers (<code>:method</code>,\n<code>:path</code>, etc.). For client-side streams, this contains response headers\n(<code>:status</code>, etc.).</p>",
              "displayName": "Channel: `quic.stream.headers`"
            },
            {
              "textRaw": "Channel: `quic.stream.trailers`",
              "name": "channel:_`quic.stream.trailers`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>trailers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The trailing headers.</li>\n</ul>\n<p>Published when trailing headers are received on a stream.</p>",
              "displayName": "Channel: `quic.stream.trailers`"
            },
            {
              "textRaw": "Channel: `quic.stream.info`",
              "name": "channel:_`quic.stream.info`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>headers</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The informational headers.</li>\n</ul>\n<p>Published when informational (1xx) headers are received on a stream\n(e.g., 103 Early Hints).</p>",
              "displayName": "Channel: `quic.stream.info`"
            },
            {
              "textRaw": "Channel: `quic.stream.reset`",
              "name": "channel:_`quic.stream.reset`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The QUIC error associated with the reset.</li>\n</ul>\n<p>Published when a stream receives a STOP_SENDING or RESET_STREAM frame\nfrom the peer, indicating the peer has aborted the stream. This is a\nkey signal for diagnosing application-level issues such as cancelled\nrequests.</p>",
              "displayName": "Channel: `quic.stream.reset`"
            },
            {
              "textRaw": "Channel: `quic.stream.blocked`",
              "name": "channel:_`quic.stream.blocked`",
              "type": "module",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>stream</code> <a href=\"quic.html#class-quicquicstream\"><code>&#x3C;quic.QuicStream></code></a></li>\n<li><code>session</code> <a href=\"quic.html#class-quicquicsession\"><code>&#x3C;quic.QuicSession></code></a></li>\n</ul>\n<p>Published when a stream is flow-control blocked and cannot send data\nuntil the peer increases the flow control window. Useful for diagnosing\nthroughput issues caused by flow control.</p>",
              "displayName": "Channel: `quic.stream.blocked`"
            }
          ],
          "displayName": "Diagnostic Channels"
        }
      ],
      "methods": [
        {
          "textRaw": "`quic.connect(address[, options])`",
          "name": "connect",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`address` {string|net.SocketAddress}",
                  "name": "address",
                  "type": "string|net.SocketAddress"
                },
                {
                  "textRaw": "`options` {quic.SessionOptions}",
                  "name": "options",
                  "type": "quic.SessionOptions",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} a promise for a {quic.QuicSession}",
                "name": "return",
                "type": "Promise",
                "desc": "a promise for a {quic.QuicSession}"
              }
            }
          ],
          "desc": "<p>Initiate a new client-side session.</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:quic';\nimport { Buffer } from 'node:buffer';\n\nconst enc = new TextEncoder();\nconst alpn = 'foo';\nconst client = await connect('123.123.123.123:8888', { alpn });\nawait client.createUnidirectionalStream({\n  body: enc.encode('hello world'),\n});\n</code></pre>\n<p>By default, every call to <code>connect(...)</code> will create a new local\n<code>QuicEndpoint</code> instance bound to a new random local IP port. To\nspecify the exact local address to use, or to multiplex multiple\nQUIC sessions over a single local port, pass the <code>endpoint</code> option\nwith either a <code>QuicEndpoint</code> or <code>EndpointOptions</code> as the argument.</p>\n<pre><code class=\"language-mjs\">import { QuicEndpoint, connect } from 'node:quic';\n\nconst endpoint = new QuicEndpoint({\n  address: '127.0.0.1:1234',\n});\n\nconst client = await connect('123.123.123.123:8888', { endpoint });\n</code></pre>"
        },
        {
          "textRaw": "`quic.listen(onsession[, options])`",
          "name": "listen",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`onsession` {quic.OnSessionCallback}",
                  "name": "onsession",
                  "type": "quic.OnSessionCallback"
                },
                {
                  "textRaw": "`options` {quic.SessionOptions}",
                  "name": "options",
                  "type": "quic.SessionOptions",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} a promise for a {quic.QuicEndpoint}",
                "name": "return",
                "type": "Promise",
                "desc": "a promise for a {quic.QuicEndpoint}"
              }
            }
          ],
          "desc": "<p>Configures the endpoint to listen as a server. When a new session is initiated by\na remote peer, the given <code>onsession</code> callback will be invoked with the created\nsession.</p>\n<pre><code class=\"language-mjs\">import { listen } from 'node:quic';\n\nconst endpoint = await listen((session) => {\n  // ... handle the session\n});\n\n// Closing the endpoint allows any sessions open when close is called\n// to complete naturally while preventing new sessions from being\n// initiated. Once all existing sessions have finished, the endpoint\n// will be destroyed. The call returns a promise that is resolved once\n// the endpoint is destroyed.\nawait endpoint.close();\n</code></pre>\n<p>By default, every call to <code>listen(...)</code> will create a new local\n<code>QuicEndpoint</code> instance bound to a new random local IP port. To\nspecify the exact local address to use, or to multiplex multiple\nQUIC sessions over a single local port, pass the <code>endpoint</code> option\nwith either a <code>QuicEndpoint</code> or <code>EndpointOptions</code> as the argument.</p>\n<p>At most, any single <code>QuicEndpoint</code> can only be configured to listen as\na server once.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "{Object}",
          "name": "constants",
          "type": "Object",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>An object containing commonly used constants for QUIC configuration.</p>",
          "properties": [
            {
              "textRaw": "{Object}",
              "name": "cc",
              "type": "Object",
              "desc": "<p>Congestion control algorithm identifiers, for use with the\n<a href=\"#sessionoptionscc\"><code>sessionOptions.cc</code></a> option:</p>\n<ul>\n<li><code>quic.constants.cc.RENO</code> — Reno congestion control.</li>\n<li><code>quic.constants.cc.CUBIC</code> — CUBIC congestion control.</li>\n<li><code>quic.constants.cc.BBR</code> — BBR congestion control.</li>\n</ul>"
            },
            {
              "textRaw": "{string}",
              "name": "DEFAULT_CIPHERS",
              "type": "string",
              "desc": "<p>The default TLS 1.3 cipher suite list used when <a href=\"#sessionoptionsciphers\"><code>sessionOptions.ciphers</code></a>\nis not specified.</p>"
            },
            {
              "textRaw": "{string}",
              "name": "DEFAULT_GROUPS",
              "type": "string",
              "desc": "<p>The default TLS 1.3 key-exchange group list used when\n<a href=\"#sessionoptionsgroups\"><code>sessionOptions.groups</code></a> is not specified.</p>"
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `QuicEndpoint`",
          "name": "QuicEndpoint",
          "type": "class",
          "desc": "<p>A <code>QuicEndpoint</code> encapsulates the local UDP-port binding for QUIC. It can be\nused as both a client and a server.</p>",
          "signatures": [
            {
              "textRaw": "`new QuicEndpoint([options])`",
              "name": "QuicEndpoint",
              "type": "ctor",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`options` {quic.EndpointOptions}",
                  "name": "options",
                  "type": "quic.EndpointOptions",
                  "optional": true
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {net.SocketAddress|undefined}",
              "name": "address",
              "type": "net.SocketAddress|undefined",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The local UDP socket address to which the endpoint is bound, if any.</p>\n<p>If the endpoint is not currently bound then the value will be <code>undefined</code>. Read only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "busy",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>endpoint.busy</code> is set to true, the endpoint will temporarily reject\nnew sessions from being created. Read/write.</p>\n<pre><code class=\"language-mjs\">// Mark the endpoint busy. New sessions will be prevented.\nendpoint.busy = true;\n\n// Mark the endpoint free. New session will be allowed.\nendpoint.busy = false;\n</code></pre>\n<p>The <code>busy</code> property is useful when the endpoint is under heavy load and needs to\ntemporarily reject new sessions while it catches up.</p>"
            },
            {
              "textRaw": "Type: {Promise}",
              "name": "closed",
              "type": "Promise",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>A promise that is fulfilled when the endpoint is destroyed. This will be the same promise that is\nreturned by the <code>endpoint.close()</code> function. Read only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "closing",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>True if <code>endpoint.close()</code> has been called and closing the endpoint has not yet completed.\nRead only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "destroyed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>True if <code>endpoint.destroy()</code> has been called. Read only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "listening",
              "type": "boolean",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>True if the endpoint is actively listening for incoming connections. Read only.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxConnectionsPerHost",
              "type": "number",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The maximum number of concurrent connections allowed per remote IP address.\n<code>0</code> means unlimited (default). Can be set at construction time via the\n<code>maxConnectionsPerHost</code> option and changed dynamically at any time.\nThe valid range is <code>0</code> to <code>65535</code>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxConnectionsTotal",
              "type": "number",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The maximum total number of concurrent connections across all remote\naddresses. <code>0</code> means unlimited (default). Can be set at construction time via\nthe <code>maxConnectionsTotal</code> option and changed dynamically at any time.\nThe valid range is <code>0</code> to <code>65535</code>.</p>"
            },
            {
              "textRaw": "Type: {quic.QuicEndpoint.Stats}",
              "name": "stats",
              "type": "quic.QuicEndpoint.Stats",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The statistics collected for an active endpoint. Read only.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`endpoint.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Gracefully close the endpoint. The endpoint will close and destroy itself when\nall currently open sessions close. Once called, new sessions will be rejected.</p>\n<p>Returns a promise that is fulfilled when the endpoint is destroyed.</p>"
            },
            {
              "textRaw": "`endpoint.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {any}",
                      "name": "error",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Forcefully closes the endpoint by forcing all open sessions to be immediately\nclosed.</p>"
            },
            {
              "textRaw": "`endpoint.setSNIContexts(entries[, options])`",
              "name": "setSNIContexts",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`entries` {object} An object mapping host names to TLS identity options. Each entry must include `keys` and `certs`.",
                      "name": "entries",
                      "type": "object",
                      "desc": "An object mapping host names to TLS identity options. Each entry must include `keys` and `certs`."
                    },
                    {
                      "textRaw": "`options` {object}",
                      "name": "options",
                      "type": "object",
                      "options": [
                        {
                          "textRaw": "`replace` {boolean} If `true`, replaces the entire SNI map. If `false` (the default), merges the entries into the existing map.",
                          "name": "replace",
                          "type": "boolean",
                          "desc": "If `true`, replaces the entire SNI map. If `false` (the default), merges the entries into the existing map."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Replaces or updates the SNI TLS contexts for this endpoint. This allows\nchanging the TLS identity (key/certificate) used for specific host names\nwithout restarting the endpoint. Existing sessions are unaffected — only\nnew sessions will use the updated contexts.</p>\n<pre><code class=\"language-mjs\">endpoint.setSNIContexts({\n  'api.example.com': { keys: [newApiKey], certs: [newApiCert] },\n});\n\n// Replace the entire SNI map\nendpoint.setSNIContexts({\n  'api.example.com': { keys: [newApiKey], certs: [newApiCert] },\n}, { replace: true });\n</code></pre>"
            },
            {
              "textRaw": "`endpoint[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <code>endpoint.close()</code> and returns a promise that fulfills when the\nendpoint has closed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `QuicEndpoint.Stats`",
          "name": "QuicEndpoint.Stats",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "desc": "<p>A view of the collected statistics for an endpoint.</p>",
          "properties": [
            {
              "textRaw": "Type: {bigint} A timestamp indicating the moment the endpoint was created. Read only.",
              "name": "createdAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating the moment the endpoint was created. Read only."
            },
            {
              "textRaw": "Type: {bigint} A timestamp indicating the moment the endpoint was destroyed. Read only.",
              "name": "destroyedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating the moment the endpoint was destroyed. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of bytes received by this endpoint. Read only.",
              "name": "bytesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of bytes received by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of bytes sent by this endpoint. Read only.",
              "name": "bytesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of bytes sent by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of QUIC packets successfully received by this endpoint. Read only.",
              "name": "packetsReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of QUIC packets successfully received by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of QUIC packets successfully sent by this endpoint. Read only.",
              "name": "packetsSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of QUIC packets successfully sent by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of peer-initiated sessions received by this endpoint. Read only.",
              "name": "serverSessions",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of peer-initiated sessions received by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of sessions initiated by this endpoint. Read only.",
              "name": "clientSessions",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of sessions initiated by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of times an initial packet was rejected due to the endpoint being marked busy. Read only.",
              "name": "serverBusyCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of times an initial packet was rejected due to the endpoint being marked busy. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of QUIC retry attempts on this endpoint. Read only.",
              "name": "retryCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of QUIC retry attempts on this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of sessions rejected due to QUIC version mismatch. Read only.",
              "name": "versionNegotiationCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of sessions rejected due to QUIC version mismatch. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of stateless resets handled by this endpoint. Read only.",
              "name": "statelessResetCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of stateless resets handled by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of sessions that were closed before handshake completed. Read only.",
              "name": "immediateCloseCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "The total number of sessions that were closed before handshake completed. Read only."
            }
          ]
        },
        {
          "textRaw": "Class: `QuicSession`",
          "name": "QuicSession",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "desc": "<p>A <code>QuicSession</code> represents the local side of a QUIC connection.</p>",
          "methods": [
            {
              "textRaw": "`session.close([options])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`code` {bigint|number} The error code to include in the `CONNECTION_CLOSE` frame sent to the peer. **Default:** `0` (no error).",
                          "name": "code",
                          "type": "bigint|number",
                          "default": "`0` (no error)",
                          "desc": "The error code to include in the `CONNECTION_CLOSE` frame sent to the peer."
                        },
                        {
                          "textRaw": "`type` {string} Either `'transport'` or `'application'`. Determines the error code namespace used in the `CONNECTION_CLOSE` frame. When `'transport'` (the default), the frame type is `0x1c` and the code is interpreted as a QUIC transport error. When `'application'`, the frame type is `0x1d` and the code is application-specific. **Default:** `'transport'`.",
                          "name": "type",
                          "type": "string",
                          "default": "`'transport'`",
                          "desc": "Either `'transport'` or `'application'`. Determines the error code namespace used in the `CONNECTION_CLOSE` frame. When `'transport'` (the default), the frame type is `0x1c` and the code is interpreted as a QUIC transport error. When `'application'`, the frame type is `0x1d` and the code is application-specific."
                        },
                        {
                          "textRaw": "`reason` {string} An optional human-readable reason string included in the `CONNECTION_CLOSE` frame. Per RFC 9000, this is for diagnostic purposes only and should not be used for machine-readable error descriptions.",
                          "name": "reason",
                          "type": "string",
                          "desc": "An optional human-readable reason string included in the `CONNECTION_CLOSE` frame. Per RFC 9000, this is for diagnostic purposes only and should not be used for machine-readable error descriptions."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Initiate a graceful close of the session. Existing streams will be allowed\nto complete but no new streams will be opened. Once all streams have closed,\nthe session will be destroyed. The returned promise will be fulfilled once\nthe session has been destroyed. If a non-zero <code>code</code> is specified, the\npromise will reject with an <code>ERR_QUIC_TRANSPORT_ERROR</code> or\n<code>ERR_QUIC_APPLICATION_ERROR</code> depending on the <code>type</code>.</p>"
            },
            {
              "textRaw": "`session.destroy([error[, options]])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {any}",
                      "name": "error",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`code` {bigint|number} The error code to include in the `CONNECTION_CLOSE` frame sent to the peer. **Default:** `0`.",
                          "name": "code",
                          "type": "bigint|number",
                          "default": "`0`",
                          "desc": "The error code to include in the `CONNECTION_CLOSE` frame sent to the peer."
                        },
                        {
                          "textRaw": "`type` {string} Either `'transport'` or `'application'`. **Default:** `'transport'`.",
                          "name": "type",
                          "type": "string",
                          "default": "`'transport'`",
                          "desc": "Either `'transport'` or `'application'`."
                        },
                        {
                          "textRaw": "`reason` {string} An optional human-readable reason string included in the `CONNECTION_CLOSE` frame.",
                          "name": "reason",
                          "type": "string",
                          "desc": "An optional human-readable reason string included in the `CONNECTION_CLOSE` frame."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Immediately destroy the session. All streams will be destroyed and the\nsession will be closed. If <code>error</code> is provided and <a href=\"#sessiononerror\"><code>session.onerror</code></a> is\nset, the <code>onerror</code> callback is invoked before destruction. The\n<code>session.closed</code> promise will reject with the error. If <code>options</code> is\nprovided, the <code>CONNECTION_CLOSE</code> frame sent to the peer will include the\nspecified error code, type, and reason.</p>"
            },
            {
              "textRaw": "`session.createBidirectionalStream([options])`",
              "name": "createBidirectionalStream",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`body` {string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null} The outbound body source. See `stream.setBody()` for details on supported types. When omitted, the stream starts half-closed (writable side open, no body queued).",
                          "name": "body",
                          "type": "string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null",
                          "desc": "The outbound body source. See `stream.setBody()` for details on supported types. When omitted, the stream starts half-closed (writable side open, no body queued)."
                        },
                        {
                          "textRaw": "`headers` {Object} Initial request or response headers to send. Only used when the session supports headers (e.g. HTTP/3). If `body` is not specified and `headers` is provided, the stream is treated as headers-only (terminal).",
                          "name": "headers",
                          "type": "Object",
                          "desc": "Initial request or response headers to send. Only used when the session supports headers (e.g. HTTP/3). If `body` is not specified and `headers` is provided, the stream is treated as headers-only (terminal)."
                        },
                        {
                          "textRaw": "`priority` {string} The priority level of the stream. One of `'high'`, `'default'`, or `'low'`. **Default:** `'default'`.",
                          "name": "priority",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "The priority level of the stream. One of `'high'`, `'default'`, or `'low'`."
                        },
                        {
                          "textRaw": "`incremental` {boolean} When `true`, data from this stream may be interleaved with data from other streams of the same priority level. When `false`, the stream should be completed before same-priority peers. **Default:** `false`.",
                          "name": "incremental",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, data from this stream may be interleaved with data from other streams of the same priority level. When `false`, the stream should be completed before same-priority peers."
                        },
                        {
                          "textRaw": "`highWaterMark` {number} The maximum number of bytes that the writer will buffer before `writeSync()` returns `false`. When the buffered data exceeds this limit, the caller should wait for drain before writing more. **Default:** `65536` (64 KB).",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "The maximum number of bytes that the writer will buffer before `writeSync()` returns `false`. When the buffered data exceeds this limit, the caller should wait for drain before writing more."
                        },
                        {
                          "textRaw": "`onheaders` {Function} Callback for received initial response headers. Called with `(headers)`.",
                          "name": "onheaders",
                          "type": "Function",
                          "desc": "Callback for received initial response headers. Called with `(headers)`."
                        },
                        {
                          "textRaw": "`ontrailers` {Function} Callback for received trailing headers. Called with `(trailers)`.",
                          "name": "ontrailers",
                          "type": "Function",
                          "desc": "Callback for received trailing headers. Called with `(trailers)`."
                        },
                        {
                          "textRaw": "`oninfo` {Function} Callback for received informational (1xx) headers. Called with `(headers)`.",
                          "name": "oninfo",
                          "type": "Function",
                          "desc": "Callback for received informational (1xx) headers. Called with `(headers)`."
                        },
                        {
                          "textRaw": "`onwanttrailers` {Function} Callback when trailers should be sent. Called with no arguments; use `stream.sendTrailers()` within the callback.",
                          "name": "onwanttrailers",
                          "type": "Function",
                          "desc": "Callback when trailers should be sent. Called with no arguments; use `stream.sendTrailers()` within the callback."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} for a {quic.QuicStream}",
                    "name": "return",
                    "type": "Promise",
                    "desc": "for a {quic.QuicStream}"
                  }
                }
              ],
              "desc": "<p>Open a new bidirectional stream. If the <code>body</code> option is not specified,\nthe outgoing stream will be half-closed. The <code>priority</code> and <code>incremental</code>\noptions are only used when the session supports priority (e.g. HTTP/3).\nThe <code>headers</code>, <code>onheaders</code>, <code>ontrailers</code>, <code>oninfo</code>, and <code>onwanttrailers</code>\noptions are only used when the session supports headers (e.g. HTTP/3).</p>"
            },
            {
              "textRaw": "`session.createUnidirectionalStream([options])`",
              "name": "createUnidirectionalStream",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`body` {string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null} The outbound body source. See `stream.setBody()` for details on supported types. When omitted, the stream is closed immediately.",
                          "name": "body",
                          "type": "string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null",
                          "desc": "The outbound body source. See `stream.setBody()` for details on supported types. When omitted, the stream is closed immediately."
                        },
                        {
                          "textRaw": "`headers` {Object} Initial request headers to send.",
                          "name": "headers",
                          "type": "Object",
                          "desc": "Initial request headers to send."
                        },
                        {
                          "textRaw": "`priority` {string} The priority level of the stream. One of `'high'`, `'default'`, or `'low'`. **Default:** `'default'`.",
                          "name": "priority",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "The priority level of the stream. One of `'high'`, `'default'`, or `'low'`."
                        },
                        {
                          "textRaw": "`incremental` {boolean} When `true`, data from this stream may be interleaved with data from other streams of the same priority level. When `false`, the stream should be completed before same-priority peers. **Default:** `false`.",
                          "name": "incremental",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, data from this stream may be interleaved with data from other streams of the same priority level. When `false`, the stream should be completed before same-priority peers."
                        },
                        {
                          "textRaw": "`highWaterMark` {number} The maximum number of bytes that the writer will buffer before `writeSync()` returns `false`. When the buffered data exceeds this limit, the caller should wait for drain before writing more. **Default:** `65536` (64 KB).",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "The maximum number of bytes that the writer will buffer before `writeSync()` returns `false`. When the buffered data exceeds this limit, the caller should wait for drain before writing more."
                        },
                        {
                          "textRaw": "`onheaders` {Function} Callback for received initial response headers. Called with `(headers)`.",
                          "name": "onheaders",
                          "type": "Function",
                          "desc": "Callback for received initial response headers. Called with `(headers)`."
                        },
                        {
                          "textRaw": "`ontrailers` {Function} Callback for received trailing headers. Called with `(trailers)`.",
                          "name": "ontrailers",
                          "type": "Function",
                          "desc": "Callback for received trailing headers. Called with `(trailers)`."
                        },
                        {
                          "textRaw": "`oninfo` {Function} Callback for received informational (1xx) headers. Called with `(headers)`.",
                          "name": "oninfo",
                          "type": "Function",
                          "desc": "Callback for received informational (1xx) headers. Called with `(headers)`."
                        },
                        {
                          "textRaw": "`onwanttrailers` {Function} Callback when trailers should be sent.",
                          "name": "onwanttrailers",
                          "type": "Function",
                          "desc": "Callback when trailers should be sent."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} for a {quic.QuicStream}",
                    "name": "return",
                    "type": "Promise",
                    "desc": "for a {quic.QuicStream}"
                  }
                }
              ],
              "desc": "<p>Open a new unidirectional stream. If the <code>body</code> option is not specified,\nthe outgoing stream will be closed. The <code>priority</code> and <code>incremental</code>\noptions are only used when the session supports priority (e.g. HTTP/3).</p>"
            },
            {
              "textRaw": "`session.sendDatagram(datagram[, encoding])`",
              "name": "sendDatagram",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`datagram` {string|Promise}",
                      "name": "datagram",
                      "type": "string|Promise"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding to use if `datagram` is a string. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The encoding to use if `datagram` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} for a {bigint} datagram ID.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "for a {bigint} datagram ID."
                  }
                }
              ],
              "desc": "<p>Sends an unreliable datagram to the remote peer, returning a promise for\nthe datagram ID.</p>\n<p>If <code>datagram</code> is a string, it will be encoded using the specified <code>encoding</code>.</p>\n<p>If <code>datagram</code> is an <code>ArrayBufferView</code>, the bytes are copied into an\ninternal buffer; the caller's source buffer is unchanged and may be reused\nor mutated immediately after the call returns. Callers that want to ensure\ntheir source cannot be mutated after the call (for example, when handing\nthe buffer off to another async consumer) can call\n<code>ArrayBuffer.prototype.transfer()</code> themselves before passing the buffer.</p>\n<p>If <code>datagram</code> is a <code>Promise</code>, it will be awaited before sending. If the\nsession closes while awaiting, <code>0n</code> is returned silently (datagrams are\ninherently unreliable).</p>\n<p>If the datagram payload is zero-length (empty string after encoding, detached\nbuffer, or zero-length view), <code>0n</code> is returned and no datagram is sent.</p>\n<p>For HTTP/3 sessions, the peer must advertise <code>SETTINGS_H3_DATAGRAM=1</code>\n(via <code>application: { enableDatagrams: true }</code>) for datagrams to be sent.\nIf the peer's setting is <code>0</code>, <code>sendDatagram()</code> returns <code>0n</code> (per RFC 9297\n§3, an endpoint MUST NOT send HTTP Datagrams unless the peer indicated\nsupport).</p>\n<p>Datagrams cannot be fragmented — each must fit within a single QUIC packet.\nThe maximum datagram size is determined by the peer's\n<code>maxDatagramFrameSize</code> transport parameter (which the peer advertises during\nthe handshake). If the peer sets this to <code>0</code>, datagrams are not supported\nand <code>0n</code> will be returned. If the datagram exceeds the peer's limit, it\nwill be silently dropped and <code>0n</code> returned. The local\n<code>maxDatagramFrameSize</code> transport parameter (default: <code>1200</code> bytes) controls\nwhat this endpoint advertises to the peer as its own maximum.</p>"
            },
            {
              "textRaw": "`session.updateKey()`",
              "name": "updateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Initiate a key update for the session.</p>"
            },
            {
              "textRaw": "`session[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <code>session.close()</code> and returns a promise that fulfills when the\nsession has closed.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Promise} for an {Object}",
              "name": "opened",
              "type": "Promise",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>A promise that is fulfilled once the TLS handshake completes successfully.\nThe resolved value contains information about the established session\nincluding the negotiated protocol, cipher suite, certificate validation\nstatus, and 0-RTT early data status.</p>\n<p>If the handshake fails or the session is destroyed before the handshake\ncompletes, the promise will be rejected.</p>",
              "options": [
                {
                  "textRaw": "`local` {net.SocketAddress} The local socket address.",
                  "name": "local",
                  "type": "net.SocketAddress",
                  "desc": "The local socket address."
                },
                {
                  "textRaw": "`remote` {net.SocketAddress} The remote socket address.",
                  "name": "remote",
                  "type": "net.SocketAddress",
                  "desc": "The remote socket address."
                },
                {
                  "textRaw": "`servername` {string} The SNI server name negotiated during the handshake.",
                  "name": "servername",
                  "type": "string",
                  "desc": "The SNI server name negotiated during the handshake."
                },
                {
                  "textRaw": "`protocol` {string} The ALPN protocol negotiated during the handshake.",
                  "name": "protocol",
                  "type": "string",
                  "desc": "The ALPN protocol negotiated during the handshake."
                },
                {
                  "textRaw": "`cipher` {string} The name of the negotiated TLS cipher suite.",
                  "name": "cipher",
                  "type": "string",
                  "desc": "The name of the negotiated TLS cipher suite."
                },
                {
                  "textRaw": "`cipherVersion` {string} The TLS protocol version of the cipher suite (e.g., `'TLSv1.3'`).",
                  "name": "cipherVersion",
                  "type": "string",
                  "desc": "The TLS protocol version of the cipher suite (e.g., `'TLSv1.3'`)."
                },
                {
                  "textRaw": "`validationErrorReason` {string} If certificate validation failed, the reason string. Empty string if validation succeeded.",
                  "name": "validationErrorReason",
                  "type": "string",
                  "desc": "If certificate validation failed, the reason string. Empty string if validation succeeded."
                },
                {
                  "textRaw": "`validationErrorCode` {number} If certificate validation failed, the error code. `0` if validation succeeded.",
                  "name": "validationErrorCode",
                  "type": "number",
                  "desc": "If certificate validation failed, the error code. `0` if validation succeeded."
                },
                {
                  "textRaw": "`earlyDataAttempted` {boolean} Whether 0-RTT early data was attempted.",
                  "name": "earlyDataAttempted",
                  "type": "boolean",
                  "desc": "Whether 0-RTT early data was attempted."
                },
                {
                  "textRaw": "`earlyDataAccepted` {boolean} Whether 0-RTT early data was accepted by the server.",
                  "name": "earlyDataAccepted",
                  "type": "boolean",
                  "desc": "Whether 0-RTT early data was accepted by the server."
                }
              ],
              "shortDesc": "for an {Object}"
            },
            {
              "textRaw": "Type: {Promise}",
              "name": "closed",
              "type": "Promise",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>A promise that is fulfilled once the session is destroyed.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "closing",
              "type": "boolean",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>True if <a href=\"#sessioncloseoptions\"><code>session.close()</code></a> has been called and the session has not yet\nbeen destroyed. Read only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "destroyed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>True if <code>session.destroy()</code> has been called. Read only.</p>"
            },
            {
              "textRaw": "Type: {quic.QuicEndpoint|null}",
              "name": "endpoint",
              "type": "quic.QuicEndpoint|null",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The endpoint that created this session. Returns <code>null</code> if the session\nhas been destroyed. Read only.</p>"
            },
            {
              "textRaw": "Type: {Function|undefined}",
              "name": "onerror",
              "type": "Function|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>An optional callback invoked when the session is destroyed with an error.\nThis includes errors caused by user callbacks that throw or reject (see\n<a href=\"#callback-error-handling\">Callback error handling</a>). The callback receives a single argument: the\nerror that triggered the destruction. If the <code>onerror</code> callback itself throws\nor returns a promise that rejects, the error is surfaced as an uncaught\nexception. Read/write.</p>\n<p>Can also be set via the <code>onerror</code> option in <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> or\n<a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {quic.OnStreamCallback}",
              "name": "onstream",
              "type": "quic.OnStreamCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when a new stream is initiated by a remote peer. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnDatagramCallback}",
              "name": "ondatagram",
              "type": "quic.OnDatagramCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when a new datagram is received from a remote peer. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnDatagramStatusCallback}",
              "name": "ondatagramstatus",
              "type": "quic.OnDatagramStatusCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the status of a datagram is updated. Read/write.</p>"
            },
            {
              "textRaw": "Type: {Function|undefined}",
              "name": "onearlyrejected",
              "type": "Function|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the server rejects 0-RTT early data. When\nthis fires, all streams that were opened during the 0-RTT phase have\nbeen destroyed. The application should re-open streams if needed.\nRead/write.</p>\n<p>This callback only fires on the client side when the server rejects\nthe client's 0-RTT attempt. The connection falls back to 1-RTT and\ncontinues normally.</p>"
            },
            {
              "textRaw": "Type: {quic.OnPathValidationCallback}",
              "name": "onpathvalidation",
              "type": "quic.OnPathValidationCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the path validation is updated. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnSessionTicketCallback}",
              "name": "onsessionticket",
              "type": "quic.OnSessionTicketCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when a new session ticket is received. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnVersionNegotiationCallback}",
              "name": "onversionnegotiation",
              "type": "quic.OnVersionNegotiationCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when a version negotiation is initiated. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnHandshakeCallback}",
              "name": "onhandshake",
              "type": "quic.OnHandshakeCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the TLS handshake is completed. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnNewTokenCallback}",
              "name": "onnewtoken",
              "type": "quic.OnNewTokenCallback",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when a NEW_TOKEN token is received from the server.\nThe token can be passed as the <code>token</code> option on a future connection to\nthe same server to skip address validation. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnOriginCallback}",
              "name": "onorigin",
              "type": "quic.OnOriginCallback",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when an ORIGIN frame (RFC 9412) is received from\nthe server, indicating which origins the server is authoritative for.\nRead/write.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "ongoaway",
              "type": "Function",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the peer sends an HTTP/3 GOAWAY frame,\nindicating it is initiating a graceful shutdown. The callback receives\n<code>(lastStreamId)</code> where <code>lastStreamId</code> is a <code>{bigint}</code>:</p>\n<ul>\n<li>When <code>lastStreamId</code> is <code>-1n</code>, the peer sent a shutdown notice (intent\nto close) without specifying a stream boundary. All existing streams\nmay still be processed.</li>\n<li>When <code>lastStreamId</code> is <code>>= 0n</code>, it is the highest stream ID the peer\nmay have processed. Streams with IDs above this value were NOT\nprocessed and can be safely retried on a new connection.</li>\n</ul>\n<p>After GOAWAY is received, <code>session.createBidirectionalStream()</code> will\nthrow <code>ERR_INVALID_STATE</code>. Existing streams continue until they\ncomplete or the session closes.</p>\n<p>This callback is only relevant for HTTP/3 sessions. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnKeylogCallback}",
              "name": "onkeylog",
              "type": "quic.OnKeylogCallback",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when TLS key material is available. Requires\n<a href=\"#sessionoptionskeylog\"><code>sessionOptions.keylog</code></a> to be <code>true</code>. Each invocation receives a single\nline of <a href=\"https://udn.realityripple.com/docs/Mozilla/Projects/NSS/Key_Log_Format\">NSS Key Log Format</a> text (including a trailing newline). This is\nuseful for decrypting packet captures with tools like Wireshark. Read/write.</p>\n<p>Can also be set via the <code>onkeylog</code> option in <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> or\n<a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {quic.OnQlogCallback}",
              "name": "onqlog",
              "type": "quic.OnQlogCallback",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when qlog data is available. Requires\n<a href=\"#sessionoptionsqlog\"><code>sessionOptions.qlog</code></a> to be <code>true</code>. The callback receives a string\nchunk of <a href=\"https://www.rfc-editor.org/rfc/rfc7464\">JSON-SEQ</a> formatted qlog data and a boolean <code>fin</code> flag. When\n<code>fin</code> is <code>true</code>, the chunk is the final qlog output for this session and\nthe concatenated chunks form a complete qlog trace. Read/write.</p>\n<p>Qlog data arrives during the connection lifecycle. The first chunk contains\nthe qlog header with format metadata. Subsequent chunks contain trace\nevents. The final chunk (with <code>fin</code> set to <code>true</code>) is emitted during\nsession destruction and completes the JSON-SEQ output.</p>\n<p>Can also be set via the <code>onqlog</code> option in <a href=\"#quicconnectaddress-options\"><code>quic.connect()</code></a> or\n<a href=\"#quiclistenonsession-options\"><code>quic.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "path",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The local and remote socket addresses associated with the session. Read only.</p>",
              "options": [
                {
                  "textRaw": "`local` {net.SocketAddress}",
                  "name": "local",
                  "type": "net.SocketAddress"
                },
                {
                  "textRaw": "`remote` {net.SocketAddress}",
                  "name": "remote",
                  "type": "net.SocketAddress"
                }
              ]
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "certificate",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The local certificate as an object with properties such as <code>subject</code>,\n<code>issuer</code>, <code>valid_from</code>, <code>valid_to</code>, <code>fingerprint</code>, etc. Returns <code>undefined</code>\nif the session is destroyed or no certificate is available.</p>"
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "peerCertificate",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The peer's certificate as an object with properties such as <code>subject</code>,\n<code>issuer</code>, <code>valid_from</code>, <code>valid_to</code>, <code>fingerprint</code>, etc. Returns <code>undefined</code>\nif the session is destroyed or the peer did not present a certificate.</p>"
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "ephemeralKeyInfo",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The ephemeral key information for the session, with properties such as\n<code>type</code>, <code>name</code>, and <code>size</code>. Only available on client sessions. Returns\n<code>undefined</code> for server sessions or if the session is destroyed.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxDatagramSize",
              "type": "number",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The maximum datagram payload size in bytes that the peer will accept.\nThis is derived from the peer's <code>maxDatagramFrameSize</code> transport\nparameter minus the DATAGRAM frame overhead (type byte and variable-length\ninteger encoding). Returns <code>0</code> if the peer does not support datagrams or\nif the handshake has not yet completed. Datagrams larger than this value\nwill not be sent.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxPendingDatagrams",
              "type": "number",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The maximum number of datagrams that can be queued for sending. Datagrams\nare queued when <code>sendDatagram()</code> is called and sent opportunistically\nalongside stream data by the packet serialization loop. When the queue\nis full, the <a href=\"#sessionoptionsdatagramdroppolicy\"><code>sessionOptions.datagramDropPolicy</code></a> determines whether\nthe oldest or newest datagram is dropped. Dropped datagrams are reported\nas lost via the <code>ondatagramstatus</code> callback.</p>\n<p>This property can be changed dynamically to adjust queue capacity\nbased on application activity or memory pressure. The valid range\nis <code>0</code> to <code>65535</code>.</p>"
            },
            {
              "textRaw": "Type: {quic.QuicSession.Stats}",
              "name": "stats",
              "type": "quic.QuicSession.Stats",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Return the current statistics for the session. Read only.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `QuicSession.Stats`",
          "name": "QuicSession.Stats",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {bigint}",
              "name": "createdAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "closingAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "handshakeCompletedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "handshakeConfirmedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bytesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bytesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bidiInStreamCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bidiOutStreamCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "uniInStreamCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "uniOutStreamCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "maxBytesInFlight",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bytesInFlight",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "blockCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "cwnd",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "latestRtt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "minRtt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "rttVar",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "smoothedRtt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "ssthresh",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "datagramsReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "datagramsSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "datagramsAcknowledged",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "datagramsLost",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            }
          ]
        },
        {
          "textRaw": "Class: `QuicError`",
          "name": "QuicError",
          "type": "class",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>A <code>QuicError</code> is an <code>Error</code> subclass that carries an explicit numeric\nQUIC error code. Use it to abort a QUIC stream or session with a\nspecific application-protocol-defined error code rather than letting\nthe implementation pick a generic fallback.</p>\n<p>The class is exported from <code>node:quic</code>:</p>\n<pre><code class=\"language-mjs\">import { QuicError } from 'node:quic';\n</code></pre>\n<pre><code class=\"language-cjs\">const { QuicError } = require('node:quic');\n</code></pre>\n<p>When a <code>QuicError</code> is supplied to APIs that emit a wire frame\n(<a href=\"#streamwriter\"><code>writer.fail()</code></a>, <a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a>), the QUIC stack uses\n<a href=\"#errorerrorcode\"><code>error.errorCode</code></a> as the wire code for the resulting frame.\nWhen any other value is supplied (for example a plain <code>Error</code>), the\nimplementation falls back to the negotiated application protocol's\n\"internal error\" code (<code>H3_INTERNAL_ERROR</code> (<code>0x102</code>) for HTTP/3, or\nthe QUIC transport-layer <code>INTERNAL_ERROR</code> (<code>0x1</code>) for raw QUIC).</p>\n<p>The Node.js error code (<code>error.code</code>) defaults to\n<code>'ERR_QUIC_STREAM_ABORTED'</code>. Callers who need a more specific code\nstring can override it via <code>options.code</code> — the numeric QUIC code\nis unaffected.</p>\n<p>The Node.js error code is fixed at <code>'ERR_QUIC_STREAM_ABORTED'</code> so that\ncatch blocks can distinguish a <code>QuicError</code> from other Node.js errors\nwithout checking the prototype chain. The numeric QUIC code lives on\nthe separate <a href=\"#errorerrorcode\"><code>error.errorCode</code></a> property to avoid colliding with\nthe Node.js convention that <code>error.code</code> is a string.</p>",
          "signatures": [
            {
              "textRaw": "`new QuicError(message, options)`",
              "name": "QuicError",
              "type": "ctor",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`message` {string} A human-readable description of the error.",
                  "name": "message",
                  "type": "string",
                  "desc": "A human-readable description of the error."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`errorCode` {bigint|number} The numeric QUIC error code. Numbers are coerced to `BigInt`. Must be a non-negative 62-bit unsigned varint (`0n <= errorCode <= 2n ** 62n - 1n`).",
                      "name": "errorCode",
                      "type": "bigint|number",
                      "desc": "The numeric QUIC error code. Numbers are coerced to `BigInt`. Must be a non-negative 62-bit unsigned varint (`0n <= errorCode <= 2n ** 62n - 1n`)."
                    },
                    {
                      "textRaw": "`code` {string} The Node.js-style error code string assigned to `error.code`. Defaults to `'ERR_QUIC_STREAM_ABORTED'`.",
                      "name": "code",
                      "type": "string",
                      "desc": "The Node.js-style error code string assigned to `error.code`. Defaults to `'ERR_QUIC_STREAM_ABORTED'`."
                    },
                    {
                      "textRaw": "`type` {string} Either `'application'` (default) or `'transport'`. Indicates whether the code is defined by the negotiated application protocol (e.g. RFC 9114 for HTTP/3) or by the QUIC transport layer (RFC 9000). Stream resets always carry application codes, so the default is `'application'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "Either `'application'` (default) or `'transport'`. Indicates whether the code is defined by the negotiated application protocol (e.g. RFC 9114 for HTTP/3) or by the QUIC transport layer (RFC 9000). Stream resets always carry application codes, so the default is `'application'`."
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { QuicError } from 'node:quic';\n\nconst err = new QuicError('rejecting stream', { errorCode: 0x10cn });\nconsole.log(err.code);       // 'ERR_QUIC_STREAM_ABORTED'\nconsole.log(err.errorCode);  // 268n\nconsole.log(err.type);       // 'application'\n\nconst custom = new QuicError('custom failure', {\n  errorCode: 0x10cn,\n  code: 'ERR_MY_QUIC_FAILURE',\n});\nconsole.log(custom.code);    // 'ERR_MY_QUIC_FAILURE'\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {bigint}",
              "name": "errorCode",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The numeric QUIC error code carried by this error.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>Either <code>'application'</code> or <code>'transport'</code>. Indicates the namespace of\n<a href=\"#errorerrorcode\"><code>error.errorCode</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `QuicStream`",
          "name": "QuicStream",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {Promise}",
              "name": "closed",
              "type": "Promise",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>A promise that is fulfilled when the stream is fully closed. It resolves\nwhen the stream closes cleanly (including idle timeout). It rejects with\nan <code>ERR_QUIC_APPLICATION_ERROR</code> or <code>ERR_QUIC_TRANSPORT_ERROR</code> when the\nstream is closed due to a QUIC error (e.g., stream reset by the peer,\nCONNECTION_CLOSE with a non-zero error code).</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "destroyed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>True if <code>stream.destroy()</code> has been called.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "early",
              "type": "boolean",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>True if any data on this stream was received as 0-RTT (early data)\nbefore the TLS handshake completed. Early data is less secure and\ncould potentially be replayed by an attacker. Applications should\ntreat early data with appropriate caution.</p>\n<p>This property is only meaningful on the server side. On the client\nside, it is always <code>false</code>.</p>"
            },
            {
              "textRaw": "Type: {string|null} One of `'bidi'`, `'uni'`, or `null`.",
              "name": "direction",
              "type": "string|null",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The directionality of the stream, or <code>null</code> if the stream has been destroyed\nor is still pending. Read only.</p>",
              "shortDesc": "One of `'bidi'`, `'uni'`, or `null`."
            },
            {
              "textRaw": "Type: {number}",
              "name": "highWaterMark",
              "type": "number",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The maximum number of bytes that the writer will buffer before\n<code>writeSync()</code> returns <code>false</code>. When the buffered data exceeds this limit,\nthe caller should wait for drain before writing more.</p>\n<p>The value can be changed dynamically at any time. This is particularly\nuseful for streams received via the <code>onstream</code> callback, where the\ndefault (65536) may need to be adjusted based on application needs.\nThe valid range is <code>0</code> to <code>4294967295</code>.</p>"
            },
            {
              "textRaw": "Type: {bigint|null}",
              "name": "id",
              "type": "bigint|null",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The stream ID, or <code>null</code> if the stream has been destroyed or is still\npending. Read only.</p>"
            },
            {
              "textRaw": "Type: {Function|undefined}",
              "name": "onerror",
              "type": "Function|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>An optional callback invoked when the stream is destroyed with an error.\nThis includes errors caused by user callbacks that throw or reject (see\n<a href=\"#callback-error-handling\">Callback error handling</a>). The callback receives a single argument: the\nerror that triggered the destruction. If the <code>onerror</code> callback itself throws\nor returns a promise that rejects, the error is surfaced as an uncaught\nexception. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnBlockedCallback}",
              "name": "onblocked",
              "type": "quic.OnBlockedCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the stream is blocked. Read/write.</p>"
            },
            {
              "textRaw": "Type: {quic.OnStreamErrorCallback}",
              "name": "onreset",
              "type": "quic.OnStreamErrorCallback",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the peer aborts a direction of the stream by\nsending a <code>RESET_STREAM</code> frame (the peer abandons their writable side, so\nno further data will arrive on our readable side) or a <code>STOP_SENDING</code>\nframe (the peer asks us to stop writing on our writable side).</p>\n<p>The callback receives a Node.js error whose <code>errorCode</code> (<code>bigint</code>)\nproperty carries the application error code from the wire frame.</p>\n<p>The stream is <strong>not</strong> automatically destroyed when this callback fires —\nthe application chooses how to react. Common patterns are: ignore (and\ncontinue using the still-active direction on a bidirectional stream),\nabort the other direction with <a href=\"#streamwriter\"><code>writer.fail()</code></a>, or tear down the\nwhole stream with <a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a>. Read/write.</p>"
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "headers",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The buffered initial headers received on this stream, or <code>undefined</code> if the\napplication does not support headers or no headers have been received yet.\nFor server-side streams, this contains the request headers (e.g., <code>:method</code>,\n<code>:path</code>, <code>:scheme</code>). For client-side streams, this contains the response\nheaders (e.g., <code>:status</code>).</p>\n<p>Header names are lowercase strings. Multi-value headers are represented as\narrays. The object has <code>__proto__: null</code>.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "onheaders",
              "type": "Function",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when initial headers are received on the stream. The\ncallback receives <code>(headers)</code> where <code>headers</code> is an object (same format as\n<code>stream.headers</code>). For HTTP/3, this delivers request pseudo-headers on the\nserver side and response headers on the client side. Throws\n<code>ERR_INVALID_STATE</code> if set on a session that does not support headers.\nRead/write.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "ontrailers",
              "type": "Function",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when trailing headers are received from the peer.\nThe callback receives <code>(trailers)</code> where <code>trailers</code> is an object in the\nsame format as <code>stream.headers</code>. Throws <code>ERR_INVALID_STATE</code> if set on a\nsession that does not support headers. Read/write.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "oninfo",
              "type": "Function",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when informational (1xx) headers are received from\nthe server. The callback receives <code>(headers)</code> where <code>headers</code> is an object\nin the same format as <code>stream.headers</code>. Informational headers are sent\nbefore the final response (e.g., 103 Early Hints). Throws\n<code>ERR_INVALID_STATE</code> if set on a session that does not support headers.\nRead/write.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "onwanttrailers",
              "type": "Function",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The callback to invoke when the application is ready for trailing headers\nto be sent. This is called synchronously — the user must call\n<a href=\"#streamsendtrailersheaders\"><code>stream.sendTrailers()</code></a> within this callback. Throws\n<code>ERR_INVALID_STATE</code> if set on a session that does not support headers.\nRead/write.</p>"
            },
            {
              "textRaw": "Type: {Object|undefined}",
              "name": "pendingTrailers",
              "type": "Object|undefined",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>Set trailing headers to be sent automatically when the application requests\nthem. This is an alternative to the <a href=\"#streamonwanttrailers\"><code>stream.onwanttrailers</code></a> callback\nfor cases where the trailers are known before the body completes. Throws\n<code>ERR_INVALID_STATE</code> if set on a session that does not support headers.\nRead/write.</p>"
            },
            {
              "textRaw": "Type: {Object|null}",
              "name": "priority",
              "type": "Object|null",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The current priority of the stream. Returns <code>null</code> if the session does not\nsupport priority (e.g. non-HTTP/3) or if the stream has been destroyed.\nRead only. Use <a href=\"#streamsetpriorityoptions\"><code>stream.setPriority()</code></a> to change the priority.</p>\n<p>On client-side HTTP/3 sessions, the value reflects what was set via\n<a href=\"#streamsetpriorityoptions\"><code>stream.setPriority()</code></a>. On server-side HTTP/3 sessions, the value\nreflects the peer's requested priority (e.g., from <code>PRIORITY_UPDATE</code> frames).</p>",
              "options": [
                {
                  "textRaw": "`level` {string} One of `'high'`, `'default'`, or `'low'`.",
                  "name": "level",
                  "type": "string",
                  "desc": "One of `'high'`, `'default'`, or `'low'`."
                },
                {
                  "textRaw": "`incremental` {boolean} Whether the stream data should be interleaved with other streams of the same priority level.",
                  "name": "incremental",
                  "type": "boolean",
                  "desc": "Whether the stream data should be interleaved with other streams of the same priority level."
                }
              ]
            },
            {
              "textRaw": "Type: {Object}",
              "name": "writer",
              "type": "Object",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>Returns a Writer object for pushing data to the stream incrementally.\nThe Writer implements the stream/iter Writer interface with the\ntry-sync-fallback-to-async pattern.</p>\n<p>Only available when no <code>body</code> source was provided at creation time or via\n<a href=\"#streamsetbodybody\"><code>stream.setBody()</code></a>. Non-writable streams return an already-closed\nWriter. Throws <code>ERR_INVALID_STATE</code> if the outbound is already configured.</p>\n<p>The Writer has the following methods:</p>\n<ul>\n<li><code>writeSync(chunk)</code> — Synchronous write. Returns <code>true</code> if accepted,\n<code>false</code> if flow-controlled. Data is NOT accepted on <code>false</code>.</li>\n<li><code>write(chunk[, options])</code> — Async write with drain wait. <code>options.signal</code>\nis checked at entry but not observed during the write.</li>\n<li><code>writevSync(chunks)</code> — Synchronous vectored write. All-or-nothing.</li>\n<li><code>writev(chunks[, options])</code> — Async vectored write.</li>\n<li><code>endSync()</code> — Synchronous close. Returns total bytes or <code>-1</code>.</li>\n<li><code>end([options])</code> — Async close.</li>\n<li><code>fail(reason)</code> — Errors the stream (sends <code>RESET_STREAM</code> to peer).\nWhen <code>reason</code> is a <a href=\"#class-quicerror\"><code>QuicError</code></a>, its <a href=\"#errorerrorcode\"><code>error.errorCode</code></a> is used\nas the wire code on the resulting <code>RESET_STREAM</code> frame; otherwise\nthe wire code falls back to the negotiated application protocol's\n\"internal error\" code (<code>H3_INTERNAL_ERROR</code> (<code>0x102</code>) for HTTP/3, or\nthe QUIC transport-layer <code>INTERNAL_ERROR</code> (<code>0x1</code>) for raw QUIC).\nSee <a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a> for a full-stream abort that also resets\nthe readable side via <code>STOP_SENDING</code>.</li>\n<li><code>desiredSize</code> — Available capacity in bytes, or <code>null</code> if closed/errored.</li>\n</ul>\n<p>The bytes from each <code>writeSync()</code> / <code>writevSync()</code> / <code>write()</code> / <code>writev()</code>\ninput chunk are copied into an internal buffer, so the caller's source\nbuffer is unchanged and may be reused or mutated immediately after the\ncall returns. Callers that want to ensure a source buffer cannot be\nmutated after handing it off can call <code>ArrayBuffer.prototype.transfer()</code>\nthemselves before passing the buffer.</p>"
            },
            {
              "textRaw": "Type: {quic.QuicSession|null}",
              "name": "session",
              "type": "quic.QuicSession|null",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The session that created this stream, or <code>null</code> if the stream has been\ndestroyed. Read only.</p>"
            },
            {
              "textRaw": "Type: {quic.QuicStream.Stats}",
              "name": "stats",
              "type": "quic.QuicStream.Stats",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The current statistics for the stream. Read only.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`stream.destroy([error[, options]])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": [
                  {
                    "version": "REPLACEME",
                    "pr-url": "https://github.com/nodejs/node/pull/62876",
                    "description": "Added the `options` parameter accepting `code` and `reason`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {any}",
                      "name": "error",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`code` {bigint|number} The application error code to include in the `RESET_STREAM` and `STOP_SENDING` frames sent to the peer. Numbers are coerced to `BigInt`. When omitted, the wire code is derived from `error` (see below).",
                          "name": "code",
                          "type": "bigint|number",
                          "desc": "The application error code to include in the `RESET_STREAM` and `STOP_SENDING` frames sent to the peer. Numbers are coerced to `BigInt`. When omitted, the wire code is derived from `error` (see below)."
                        },
                        {
                          "textRaw": "`reason` {string} An optional human-readable reason string. Accepted for symmetry with `session.close()` and `session.destroy()`, but **not transmitted on the wire** — neither `RESET_STREAM` nor `STOP_SENDING` carry a reason field. Provided for application logging and for use by the `stream.onerror` callback.",
                          "name": "reason",
                          "type": "string",
                          "desc": "An optional human-readable reason string. Accepted for symmetry with `session.close()` and `session.destroy()`, but **not transmitted on the wire** — neither `RESET_STREAM` nor `STOP_SENDING` carry a reason field. Provided for application logging and for use by the `stream.onerror` callback."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Immediately and abruptly destroys the stream. If <code>error</code> is provided and\n<a href=\"#streamonerror\"><code>stream.onerror</code></a> is set, the <code>onerror</code> callback is invoked before\ndestruction. The <code>stream.closed</code> promise rejects with the error.</p>\n<p>When the stream is destroyed with an <code>error</code> (or with an explicit\n<code>options.code</code>), the QUIC stack signals the abort to the peer:</p>\n<ul>\n<li>If the writable side is still open, a <code>RESET_STREAM</code> frame is sent.</li>\n<li>If the readable side is still open (a bidirectional stream, or a\nremote-initiated unidirectional stream), a <code>STOP_SENDING</code> frame is sent.</li>\n</ul>\n<p>Both frames carry the same wire code, resolved with the following\nprecedence:</p>\n<ol>\n<li><code>options.code</code>, when explicitly provided.</li>\n<li><a href=\"#errorerrorcode\"><code>error.errorCode</code></a>, when <code>error</code> is a <a href=\"#class-quicerror\"><code>QuicError</code></a>.</li>\n<li>The negotiated application protocol's \"internal error\" code\n(<code>H3_INTERNAL_ERROR</code> (<code>0x102</code>) for HTTP/3, or the QUIC transport-layer\n<code>INTERNAL_ERROR</code> (<code>0x1</code>) for raw QUIC).</li>\n</ol>\n<p>A clean destroy — no <code>error</code> and no <code>options.code</code> — does not emit\n<code>RESET_STREAM</code> or <code>STOP_SENDING</code>; the stream's existing close machinery\nhandles teardown.</p>\n<p>See <a href=\"#aborting-a-stream\">Aborting a stream</a> for an overview of the available stream-abort\nAPIs.</p>"
            },
            {
              "textRaw": "`stream.sendHeaders(headers[, options])`",
              "name": "sendHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Object} Header object with string keys and string or string-array values. Pseudo-headers (`:method`, `:path`, etc.) must appear before regular headers.",
                      "name": "headers",
                      "type": "Object",
                      "desc": "Header object with string keys and string or string-array values. Pseudo-headers (`:method`, `:path`, etc.) must appear before regular headers."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`terminal` {boolean} If `true`, the stream is closed for sending after the headers (no body will follow). **Default:** `false`.",
                          "name": "terminal",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the stream is closed for sending after the headers (no body will follow)."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends initial or response headers on the stream. For client-side streams,\nthis sends request headers. For server-side streams, this sends response\nheaders. Throws <code>ERR_INVALID_STATE</code> if the session does not support headers.</p>"
            },
            {
              "textRaw": "`stream.sendInformationalHeaders(headers)`",
              "name": "sendInformationalHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Object} Header object. Must include `:status` with a 1xx value (e.g., `{ ':status': '103', 'link': '</style.css>; rel=preload' }`).",
                      "name": "headers",
                      "type": "Object",
                      "desc": "Header object. Must include `:status` with a 1xx value (e.g., `{ ':status': '103', 'link': '</style.css>; rel=preload' }`)."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends informational (1xx) response headers. Server only. Throws\n<code>ERR_INVALID_STATE</code> if the session does not support headers.</p>"
            },
            {
              "textRaw": "`stream.sendTrailers(headers)`",
              "name": "sendTrailers",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Object} Trailing header object. Pseudo-headers must not be included in trailers.",
                      "name": "headers",
                      "type": "Object",
                      "desc": "Trailing header object. Pseudo-headers must not be included in trailers."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends trailing headers on the stream. Must be called synchronously during\nthe <a href=\"#streamonwanttrailers\"><code>stream.onwanttrailers</code></a> callback, or set ahead of time via\n<a href=\"#streampendingtrailers\"><code>stream.pendingTrailers</code></a>. Throws <code>ERR_INVALID_STATE</code> if the session\ndoes not support headers.</p>"
            },
            {
              "textRaw": "`stream.setPriority([options])`",
              "name": "setPriority",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`level` {string} The priority level. One of `'high'`, `'default'`, or `'low'`. **Default:** `'default'`.",
                          "name": "level",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "The priority level. One of `'high'`, `'default'`, or `'low'`."
                        },
                        {
                          "textRaw": "`incremental` {boolean} When `true`, data from this stream may be interleaved with data from other streams of the same priority level. **Default:** `false`.",
                          "name": "incremental",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, data from this stream may be interleaved with data from other streams of the same priority level."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the priority of the stream. Throws <code>ERR_INVALID_STATE</code> if the session\ndoes not support priority (e.g. non-HTTP/3). Has no effect if the stream\nhas been destroyed.</p>"
            },
            {
              "textRaw": "`stream[Symbol.asyncIterator]()`",
              "name": "[Symbol.asyncIterator]",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {AsyncIterableIterator} yielding {Uint8Array[]}",
                    "name": "return",
                    "type": "AsyncIterableIterator",
                    "desc": "yielding {Uint8Array[]}"
                  }
                }
              ],
              "desc": "<p>The stream implements <code>Symbol.asyncIterator</code>, making it directly usable\nin <code>for await...of</code> loops. Each iteration yields a batch of <code>Uint8Array</code>\nchunks.</p>\n<p>Only one async iterator can be obtained per stream. A second call throws\n<code>ERR_INVALID_STATE</code>. Non-readable streams (outbound-only unidirectional\nor closed) return an immediately-finished iterator.</p>\n<pre><code class=\"language-mjs\">for await (const chunks of stream) {\n  for (const chunk of chunks) {\n    // Process each Uint8Array chunk\n  }\n}\n</code></pre>\n<p>Compatible with stream/iter utilities:</p>\n<pre><code class=\"language-mjs\">import Stream from 'node:stream/iter';\nconst body = await Stream.bytes(stream);\nconst text = await Stream.text(stream);\nawait Stream.pipeTo(stream, someWriter);\n</code></pre>"
            },
            {
              "textRaw": "`stream.setBody(body)`",
              "name": "setBody",
              "type": "method",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`body` {string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null}",
                      "name": "body",
                      "type": "string|ArrayBuffer|SharedArrayBuffer|Blob|FileHandle|AsyncIterable|Promise|null"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the outbound body source for the stream. Can only be called once.\nMutually exclusive with <a href=\"#streamwriter\"><code>stream.writer</code></a>.</p>\n<p>The following body source types are supported:</p>\n<ul>\n<li><code>null</code> — The writable side is closed immediately (FIN sent with no data).</li>\n<li><code>string</code> — UTF-8 encoded and sent as a single chunk.</li>\n<li><code>ArrayBuffer</code>, <code>SharedArrayBuffer</code>, <code>ArrayBufferView</code> — Sent as a single\nchunk. The bytes are copied into an internal buffer, so the caller's\nsource buffer is unchanged and may be reused or mutated immediately\nafter the call returns. Callers wanting to ensure their source cannot\nbe mutated after handing it off can call\n<code>ArrayBuffer.prototype.transfer()</code> themselves before passing the buffer.</li>\n<li><code>Blob</code> — Sent from the Blob's underlying data queue.</li>\n<li><a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> — The file contents are read asynchronously via an\nfd-backed data source. The <code>FileHandle</code> must be opened for reading\n(e.g. via <a href=\"fs.html#fspromisesopenpath-flags-mode\"><code>fs.promises.open(path, 'r')</code></a>). Once passed as a body, the\n<code>FileHandle</code> is locked and cannot be used as a body for another stream.\nThe <code>FileHandle</code> is automatically closed when the stream finishes.</li>\n<li><code>AsyncIterable</code>, <code>Iterable</code> — Each yielded chunk (string or\n<code>Uint8Array</code>) is written incrementally in streaming mode.</li>\n<li><code>Promise</code> — Awaited; the resolved value is used as the body (subject\nto the same type rules).</li>\n</ul>\n<p>Throws <code>ERR_INVALID_STATE</code> if the outbound is already configured or if\nthe writer has been accessed.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Aborting a stream",
              "name": "aborting_a_stream",
              "type": "module",
              "desc": "<p>A QuicStream can be aborted in three ways, each producing different\nwire-frame side effects:</p>\n<ul>\n<li><a href=\"#streamwriter\"><code>writer.fail(reason)</code></a> — Aborts only the writable side. Sends\n<code>RESET_STREAM</code> to the peer. The readable side is unaffected; any data\nalready buffered for read remains available.</li>\n<li><a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a> with an <code>error</code> argument — Tears the stream\ndown completely. Sends <code>RESET_STREAM</code> on any still-open writable side\n<strong>and</strong> <code>STOP_SENDING</code> on any still-open readable side. The wire code\nis derived from <code>error</code> (see <a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a> for the precedence\nrules).</li>\n<li><a href=\"#streamdestroyerror-options\"><code>stream.destroy()</code></a> with an explicit <code>options.code</code> — Same as the\nprevious form but with a caller-supplied wire code, which takes\nprecedence over any code carried by <code>error</code>.</li>\n</ul>\n<p>When <code>error</code> is a <a href=\"#class-quicerror\"><code>QuicError</code></a>, its <a href=\"#errorerrorcode\"><code>error.errorCode</code></a> is used as\nthe wire code for both <code>writer.fail()</code> and <code>stream.destroy()</code>. Otherwise\nthe implementation falls back to the negotiated application protocol's\n\"internal error\" code (see <a href=\"#class-quicerror\"><code>QuicError</code></a>).</p>",
              "displayName": "Aborting a stream"
            }
          ]
        },
        {
          "textRaw": "Class: `QuicStream.Stats`",
          "name": "QuicStream.Stats",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {bigint}",
              "name": "ackedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bytesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "bytesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "createdAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "destroyedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "finalSize",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "isConnected",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "maxOffset",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "maxOffsetAcknowledged",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "maxOffsetReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "openedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "receivedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              }
            }
          ]
        }
      ],
      "displayName": "QUIC"
    }
  ]
}