Node.js module
http2
The 'node:http2' module provides an API for HTTP/2 clients and servers, including support for multiplexing streams, HPACK header compression, and server push.
Works in Bun · notes
Client & server are implemented (95.25% of gRPC's test suite passes). Some options, the ALTSVC extension, and server push functionality are missing.
Functions 7
- http2.connect()
Returns a
ClientHttp2Sessioninstance. - http2.createSecureServer()
Returns a
tls.Serverinstance that creates and managesHttp2Sessioninstances. - http2.createServer()
Returns a
net.Serverinstance that creates and managesHttp2Sessioninstances. - http2.getDefaultSettings()
Returns an object containing the default settings for an
Http2Sessioninstance. - http2.getPackedSettings()
Returns a
Bufferinstance containing serialized representation of the given - http2.getUnpackedSettings()
Returns a
HTTP/2 Settings Objectcontaining the deserialized settings from the givenBufferas generated byhttp2.getPackedSettings(). - http2.performServerHandshake()
Create an HTTP/2 server session from an existing socket.
Classes 2
- class http2.Http2ServerRequest
A
Http2ServerRequestobject is created by Server or SecureServer and passed as the first argument to the'request'event. - class http2.Http2ServerResponse
This object is created internally by an HTTP server, not by the user.
Interfaces 33
- interface AlternativeServiceOptions
- interface ClientHttp2SessionEventMap
- interface ClientHttp2Stream
Duplex streams are streams that implement both the
ReadableandWritableinterfaces. - interface ClientHttp2StreamEventMap
- interface ClientSessionOptions
- interface ClientSessionRequestOptions
- interface Http1Options
- interface Http2SecureServer
Accepts encrypted connections using TLS or SSL.
- interface Http2SecureServerEventMap
- interface Http2Server
This class is used to create a TCP or
IPCserver. - interface Http2ServerCommon
- interface Http2ServerEventMap
- interface Http2ServerRequestEventMap
- interface Http2SessionEventMap
- interface Http2Stream
Duplex streams are streams that implement both the
ReadableandWritableinterfaces. - interface Http2StreamEventMap
- interface IncomingHttpHeaders
- interface IncomingHttpStatusHeader
- interface SecureClientSessionOptions
- interface SecureServerOptions
- interface SecureServerSessionOptions
- interface ServerHttp2SessionEventMap
- interface ServerHttp2Stream
Duplex streams are streams that implement both the
ReadableandWritableinterfaces. - interface ServerOptions
- interface ServerSessionOptions
- interface ServerStreamFileResponseOptions
- interface ServerStreamFileResponseOptionsWithError
- interface ServerStreamResponseOptions
- interface SessionOptions
- interface SessionState
- interface Settings
- interface StatOptions
- interface StreamState
Variables 1
- const http2.sensitiveHeaders
This symbol can be set as a property on the HTTP/2 headers object with an array value in order to provide a list of headers considered sensitive.