Version: 1.0.1
The main governing power behind the http2 API design is that it should look very similar to the existing node.js HTTPS API (which is, in turn, almost identical to the HTTP API). The additional features of HTTP/2 are exposed as extensions to this API. Furthermore, node-http2 should fall back to using HTTP/1.1 if needed. Compatibility with undocumented or deprecated elements of the node.js HTTP/HTTPS API is a non-goal.
Additional and modified API elementsClass: http2.Endpoint: an API for using the raw HTTP/2 framing layer. For documentation see the lib/protocol/endpoint.js file.
Class: http2.Server
http2.createServer(options, [requestListener]): additional option:
true
, the server will accept HTTP/2 connections over plain TCP instead of TLSClass: http2.ServerResponse
options
describes the 'imaginary' request to which the push stream is a response; the possible options are identical to the ones accepted by http2.request
. Returns a ServerResponse object that can be used to send the response headers and content.Class: http2.Agent
http2.request(options, [callback]): additional option:
true
, the client will not try to build a TLS tunnel, instead it will use the raw TCP stream for HTTP/2Class: http2.ClientRequest
socket
is a reference to the associated HTTP/2 Stream object (and not to the TCP socket).promise
is an IncomingPromise. If there's no listener for this event, the server push is cancelled.priority
is a number between 0 (highest priority) and 2^31-1 (lowest priority). Default value is 2^30.Class: http2.IncomingMessage
Class: http2.IncomingRequest (IncomingMessage)
url
field always contains the path, and never a full url (it contains the path in most cases in the HTTPS api as well).message.headers
for backwards compatibility.Class: http2.IncomingPromise (IncomingRequest)
response
is an IncomingResponse.promise
is an IncomingPromise. If there's no listener for this event, the server push is cancelled.priority
is a number between 0 (highest priority) and 2^31-1 (lowest priority). Default value is 2^30.The reason may be deprecation of certain HTTP/1.1 features, or that some API elements simply don't make sense when using HTTP/2. These will not be present when a request is done with HTTP/2, but will function normally when falling back to using HTTP/1.1.
Class: http2.Server
Class: http2.ServerResponse
Class: http2.Agent
Class: http2.ClientRequest
Class: http2.IncomingMessage
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4