Usage in Deno
import * as mod from "node:http2";
The node:http2
module provides an implementation of the HTTP/2 protocol.
It can be accessed using:
import http2 from 'node:http2';
A Http2ServerRequest
object is created by Server or SecureServer and passed as the first argument to the 'request'
event. It may be used to access a request status,headers, anddata.
This object is created internally by an HTTP server, not by the user. It ispassed as the second parameter to the 'request'
event.
Returns a ClientHttp2Session
instance.
Returns a tls.Server
instance that creates and manages Http2Session
instances.
Returns a net.Server
instance that creates and manages Http2Session
instances.
Returns an object containing the default settings for an Http2Session
instance. This method returns a new object instance every time it is calledso instances returned may be safely modified for use.
Returns a Buffer
instance containing serialized representation of the givenHTTP/2 settings as specified in the HTTP/2 specification. This is intendedfor use with the HTTP2-Settings
header field.
Returns a HTTP/2 Settings Object
containing the deserialized settings fromthe given Buffer
as generated by http2.getPackedSettings()
.
Create an HTTP/2 server session from an existing socket.
- accept
- accept-charset
- accept-encoding
- accept-language
- accept-ranges
- access-control-allow-credentials
- access-control-allow-headers
- access-control-allow-methods
- access-control-allow-origin
- access-control-expose-headers
- access-control-max-age
- access-control-request-headers
- access-control-request-method
- age
- allow
- authorization
- cache-control
- cdn-cache-control
- connection
- content-disposition
- content-encoding
- content-language
- content-length
- content-location
- content-range
- content-security-policy
- content-security-policy-report-only
- cookie
- date
- dav
- dnt
- etag
- expect
- expires
- forwarded
- from
- host
- if-match
- if-modified-since
- if-none-match
- if-range
- if-unmodified-since
- last-modified
- link
- location
- max-forwards
- origin
- prgama
- proxy-authenticate
- proxy-authorization
- public-key-pins
- public-key-pins-report-only
- range
- referer
- referrer-policy
- refresh
- retry-after
- sec-websocket-accept
- sec-websocket-extensions
- sec-websocket-key
- sec-websocket-protocol
- sec-websocket-version
- server
- set-cookie
- strict-transport-security
- te
- trailer
- transfer-encoding
- upgrade
- upgrade-insecure-requests
- user-agent
- vary
- via
- warning
- www-authenticate
- x-content-type-options
- x-dns-prefetch-control
- x-frame-options
- x-xss-protection
This symbol can be set as a property on the HTTP/2 headers object withan array value in order to provide a list of headers considered sensitive.