Package-level declarations

Types

Link copied to clipboard
sealed external interface AlternativeServiceOptions
Link copied to clipboard
sealed external interface ClientHttp2Session : Http2Session
Link copied to clipboard
sealed external interface ClientHttp2Stream : Http2Stream
Link copied to clipboard
sealed external interface ClientSessionOptions : SessionOptions
Link copied to clipboard
sealed external interface ClientSessionOptionsProtocol
Link copied to clipboard
sealed external interface ClientSessionRequestOptions
Link copied to clipboard
sealed external interface Http2SecureServer : Server, HTTP2ServerCommon
Link copied to clipboard
sealed external interface Http2Server : Server, HTTP2ServerCommon
Link copied to clipboard
sealed external interface HTTP2ServerCommon
Link copied to clipboard
external class Http2ServerRequest : Readable

A Http2ServerRequest object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the 'request' event. It may be used to access a request status, headers, and data.

Link copied to clipboard
external class Http2ServerResponse : Writable

This object is created internally by an HTTP server, not by the user. It is passed as the second parameter to the 'request' event.

Link copied to clipboard
sealed external interface Http2Session : EventEmitter
Link copied to clipboard
sealed external interface Http2Stream : Duplex
Link copied to clipboard
sealed external interface IncomingHttpHeaders : IncomingHttpHeaders
Link copied to clipboard
sealed external interface IncomingHttpStatusHeader
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface ServerHttp2Session : Http2Session
Link copied to clipboard
sealed external interface ServerHttp2Stream : Http2Stream
Link copied to clipboard
sealed external interface ServerOptions : ServerSessionOptions
Link copied to clipboard
sealed external interface ServerSessionOptions : SessionOptions
Link copied to clipboard
sealed external interface ServerStreamFileResponseOptions
Link copied to clipboard
sealed external interface ServerStreamResponseOptions
Link copied to clipboard
sealed external interface SessionOptions
Link copied to clipboard
sealed external interface SessionState
Link copied to clipboard
sealed external interface Settings
Link copied to clipboard
sealed external interface StatOptions
Link copied to clipboard
sealed external interface StreamPriorityOptions
Link copied to clipboard
sealed external interface StreamState

Properties

Link copied to clipboard
external val sensitiveHeaders: Symbol

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.

Functions

Link copied to clipboard
external fun connect(authority: String): ClientHttp2Session
external fun connect(authority: URL): ClientHttp2Session
external fun connect(authority: String, options: ClientSessionOptions = definedExternally, listener: (session: ClientHttp2Session, socket: Any) -> Unit = definedExternally): ClientHttp2Session
external fun connect(authority: String, options: SecureClientSessionOptions = definedExternally, listener: (session: ClientHttp2Session, socket: Any) -> Unit = definedExternally): ClientHttp2Session
external fun connect(authority: URL, options: ClientSessionOptions = definedExternally, listener: (session: ClientHttp2Session, socket: Any) -> Unit = definedExternally): ClientHttp2Session
external fun connect(authority: URL, options: SecureClientSessionOptions = definedExternally, listener: (session: ClientHttp2Session, socket: Any) -> Unit = definedExternally): ClientHttp2Session

external fun connect(authority: String, listener: (session: ClientHttp2Session, socket: Any) -> Unit): ClientHttp2Session
external fun connect(authority: URL, listener: (session: ClientHttp2Session, socket: Any) -> Unit): ClientHttp2Session

Returns a ClientHttp2Session instance.

Link copied to clipboard
external fun createSecureServer(onRequestHandler: (request: Http2ServerRequest, response: Http2ServerResponse) -> Unit = definedExternally): Http2SecureServer

Returns a tls.Server instance that creates and manages Http2Session instances.

external fun createSecureServer(options: SecureServerOptions, onRequestHandler: (request: Http2ServerRequest, response: Http2ServerResponse) -> Unit = definedExternally): Http2SecureServer
Link copied to clipboard
external fun createServer(onRequestHandler: (request: Http2ServerRequest, response: Http2ServerResponse) -> Unit = definedExternally): Http2Server

Returns a net.Server instance that creates and manages Http2Session instances.

external fun createServer(options: ServerOptions, onRequestHandler: (request: Http2ServerRequest, response: Http2ServerResponse) -> Unit = definedExternally): Http2Server
Link copied to clipboard

Returns an object containing the default settings for an Http2Session instance. This method returns a new object instance every time it is called so instances returned may be safely modified for use.

Link copied to clipboard
external fun getPackedSettings(settings: Settings): Buffer

Returns a Buffer instance containing serialized representation of the given HTTP/2 settings as specified in the HTTP/2 specification. This is intended for use with the HTTP2-Settings header field.

Link copied to clipboard
external fun getUnpackedSettings(buf: Uint8Array<*>): Settings

Returns a HTTP/2 Settings Object containing the deserialized settings from the given Buffer as generated by http2.getPackedSettings().

Link copied to clipboard
external fun performServerHandshake(socket: Duplex, options: ServerOptions = definedExternally): ServerHttp2Session

Create an HTTP/2 server session from an existing socket.