Http3ServerConnection
Defined in: packages/net-http/src/h3/http3-server-connection.ts:87
Serves HTTP/3 on one QUIC connection: every request stream the client opens is a request, handled concurrently up to the QUIC stream limit.
Request bodies are read under QUIC flow control — a slow handler holds back
only its own stream — and a response sent before its request body was read
stops the request stream with H3_NO_ERROR, which tells the client to stop
sending (RFC 9114 §4.1). Aborting a handler’s signal, or the client
cancelling its stream, affects that stream only.
Extended CONNECT (RFC 9220) is advertised, so a handler can accept a
WebSocket with acceptWebSocket: a 2xx with a tunnel hands the stream
over as a Transport.
Use HttpServer to accept connections; this class is the per-connection
piece, for custom servers and tests.
Extends
Section titled “Extends”EventDispatcherMapBase<Http3ServerConnectionEvents>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Http3ServerConnection(
options):Http3ServerConnection
Defined in: packages/net-http/src/h3/http3-server-connection.ts:92
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Http3ServerConnection
Overrides
Section titled “Overrides”EventDispatcherMapBase<Http3ServerConnectionEvents>.constructor
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get idle():
boolean
Defined in: packages/net-http/src/h3/http3-server-connection.ts:119
Whether no request is open.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: packages/net-http/src/h3/http3-server-connection.ts:128
Send GOAWAY, let the open requests finish, then close.
Returns
Section titled “Returns”Promise<void>
Resolves once the connection closed.
destroy()
Section titled “destroy()”destroy(
error?):void
Defined in: packages/net-http/src/h3/http3-server-connection.ts:134
Close at once, cancelling every open request.
Parameters
Section titled “Parameters”error?
Section titled “error?”unknown
Returns
Section titled “Returns”void
isSubscribed()
Section titled “isSubscribed()”isSubscribed<
K>(event,listener):boolean
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:38
Check if a callback is subscribed to a specific event.
Type Parameters
Section titled “Type Parameters”K extends keyof Http3ServerConnectionEvents
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<Http3ServerConnectionEvents[K]>
The callback to check.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”EventDispatcherMapBase.isSubscribed
subscribe()
Section titled “subscribe()”subscribe<
K>(event,listener,options?):Callable|null
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:23
Type Parameters
Section titled “Type Parameters”K extends keyof Http3ServerConnectionEvents
Parameters
Section titled “Parameters”K
listener
Section titled “listener”Callable<Http3ServerConnectionEvents[K]>
options?
Section titled “options?”EventDispatcherSubscribeOptions
Returns
Section titled “Returns”Callable | null
Inherited from
Section titled “Inherited from”EventDispatcherMapBase.subscribe
unsubscribe()
Section titled “unsubscribe()”unsubscribe<
K>(event,listener):void
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:31
Unsubscribe a callback from a specific event.
Type Parameters
Section titled “Type Parameters”K extends keyof Http3ServerConnectionEvents
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<Http3ServerConnectionEvents[K]>
The callback to remove.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EventDispatcherMapBase.unsubscribe
wait()
Section titled “wait()”wait<
K>(event,options?):Promise<Http3ServerConnectionEvents[K]>
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:45
Wait for the next occurrence of a specific event, optionally matching a predicate.
This is a convenience method that subscribes to the dispatcher, waits for the next event that matches the predicate (if provided), and then unsubscribes automatically.
Type Parameters
Section titled “Type Parameters”K extends keyof Http3ServerConnectionEvents
Parameters
Section titled “Parameters”K
The event name to wait for.
options?
Section titled “options?”EventDispatcherWaitOptions<Http3ServerConnectionEvents[K]>
Optional settings including predicate and abort signal.
Returns
Section titled “Returns”Promise<Http3ServerConnectionEvents[K]>
A promise that resolves with the event arguments as an array.
Inherited from
Section titled “Inherited from”EventDispatcherMapBase.wait