Quic

Node.js quic module — QUIC transport protocol (experimental).

Module: node:quic Support: Experimental Since: 1.1.0 Docs: Node.js Docs

3 members: 1 supported, 2 partial

Static Methods

🟡 listen(options)
Creates a QUIC server endpoint that listens for incoming connections.
🟡 connect(address, options)
Options for connecting to a QUIC endpoint.

Properties

🟢 constants
Constants for congestion control, cipher suites, and key exchange groups.

Dictionary QuicListenOptions

Options for listening on a QUIC endpoint.

Since: 1.1.0 Docs: Node.js Docs

14 members: 1 partial, 13 undocumented

Properties

🟡 port
Options for listening on a QUIC endpoint.
⚪ address
Local port to bind to.
⚪ cert
TLS certificate chain (PEM string or Buffer).
⚪ key
TLS certificate chain (PEM string or Buffer).
⚪ alpn
List of ALPN protocol names in preference order.
⚪ ca
Trusted CA certificate(s) (PEM string, Buffer, or array).
⚪ cc
Congestion control algorithm (e.g. "reno", "cubic", "bbr").
⚪ initialMaxData
Initial maximum data that can be sent on the connection (bytes).
⚪ initialMaxStreamDataBidiLocal
Initial maximum data that can be sent on a locally-initiated bidirectional stream (bytes).
⚪ initialMaxStreamDataBidiRemote
Initial maximum data that can be sent on a remotely-initiated bidirectional stream (bytes).
⚪ initialMaxStreamDataUni
Initial maximum data that can be sent on a unidirectional stream (bytes).
⚪ initialMaxStreamsBidi
Initial maximum number of bidirectional streams the peer may open.
⚪ initialMaxStreamsUni
Initial maximum number of unidirectional streams the peer may open.
⚪ idleTimeout
Idle timeout in milliseconds.

---

Dictionary QuicConnectOptions

Options for connecting to a QUIC endpoint.

Since: 1.1.0 Docs: Node.js Docs

9 members: 1 partial, 8 undocumented

Properties

🟡 port
Options for listening on a QUIC endpoint.
⚪ alpn
List of ALPN protocol names in preference order.
⚪ servername
Server name for SNI (defaults to the address).
⚪ ca
Trusted CA certificate(s) (PEM string, Buffer, or array).
⚪ cert
TLS certificate chain (PEM string or Buffer).
⚪ key
TLS certificate chain (PEM string or Buffer).
⚪ rejectUnauthorized
If true, rejects unauthorized server certificates (default: true).
⚪ cc
Congestion control algorithm (e.g. "reno", "cubic", "bbr").
⚪ idleTimeout
Idle timeout in milliseconds.

---

Dictionary QuicStreamOptions

Options for opening a QUIC stream.

Since: 1.1.0 Docs: Node.js Docs

1 members: 1 undocumented

Properties

⚪ unidirectional
Initial maximum data that can be sent on a remotely-initiated bidirectional stream (bytes).

---

Interface QuicEndpoint

A QUIC endpoint that can accept or initiate connections. Extends EventEmitter; emits 'session', 'close', 'error' events.

Extends: EventEmitter Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs

5 members: 4 partial, 1 undocumented

Methods

🟡 close()
Gracefully closes the endpoint. All active sessions are closed.
🟡 ref()
Keeps the event loop alive as long as this endpoint is open.
🟡 unref()
Allows the event loop to exit even if this endpoint is still open.

Properties

🟡 state
The current state of the endpoint ("initial", "listening", "connected", "closing", "closed").
⚪ address
Local port to bind to.

---

Interface QuicSession

Represents a QUIC connection/session between two endpoints. Extends EventEmitter; emits 'stream', 'close', 'error', 'keylog' events.

Extends: EventEmitter Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs

7 members: 7 partial

Methods

🟡 openStream(options)
Opens a new QUIC stream on this session.
🟡 close(code, reason)
Gracefully closes the endpoint. All active sessions are closed.
🟡 updateKey()
Initiates a key update.
🟡 destroy(error)
Immediately destroys the session.

Properties

🟡 state
The current state of the endpoint ("initial", "listening", "connected", "closing", "closed").
🟡 alpnProtocol
The negotiated ALPN protocol, or null if not yet negotiated.
🟡 remoteAddress
The remote peer address, or null if not connected.

---

Interface QuicStream

Opens a new QUIC stream on this session.

Extends: EventEmitter Implements: EventEmitter

5 members: 5 partial

Methods

🟡 sendFin()
Sends a FIN, signaling that no more data will be written.
🟡 stopSending(code)
Sends a STOP_SENDING frame to the peer.
🟡 resetStream(code)
Sends a RESET_STREAM frame to the peer, aborting the stream.

Properties

🟡 id
The stream identifier assigned by the QUIC connection.
🟡 state
The current state of the endpoint ("initial", "listening", "connected", "closing", "closed").

---