@@ -2278,7 +2278,7 @@ not work.
22782278For incoming headers:
22792279* The ` :status ` header is converted to ` number ` .
22802280* Duplicates of ` :status ` , ` :method ` , ` :authority ` , ` :scheme ` , ` :path ` ,
2281- ` age ` , ` authorization ` , ` access-control-allow-credentials ` ,
2281+ ` :protocol ` , ` age ` , ` authorization ` , ` access-control-allow-credentials ` ,
22822282` access-control-max-age ` , ` access-control-request-method ` , ` content-encoding ` ,
22832283` content-language ` , ` content-length ` , ` content-location ` , ` content-md5 ` ,
22842284` content-range ` , ` content-type ` , ` date ` , ` dnt ` , ` etag ` , ` expires ` , ` from ` ,
@@ -2335,6 +2335,10 @@ properties.
23352335* ` maxHeaderListSize ` {number} Specifies the maximum size (uncompressed octets)
23362336 of header list that will be accepted. The minimum allowed value is 0. The
23372337 maximum allowed value is 2<sup >32</sup >-1. ** Default:** ` 65535 ` .
2338+ * ` enableConnectProtocol ` {boolean} Specifies ` true ` if the "Extended Connect
2339+ Protocol" defined by [ RFC 8441] [ ] is to be enabled. This setting is only
2340+ meaningful if sent by the server. Once the ` enableConnectProtocol ` setting
2341+ has been enabled for a given ` Http2Session ` , it cannot be disabled.
23382342
23392343All additional properties on the settings object are ignored.
23402344
@@ -2501,6 +2505,36 @@ req.on('end', () => {
25012505req .end (' Jane' );
25022506```
25032507
2508+ ### The Extended CONNECT Protocol
2509+
2510+ [ RFC 8441] [ ] defines an "Extended CONNECT Protocol" extension to HTTP/2 that
2511+ may be used to bootstrap the use of an ` Http2Stream ` using the ` CONNECT `
2512+ method as a tunnel for other communication protocols (such as WebSockets).
2513+
2514+ The use of the Extended CONNECT Protocol is enabled by HTTP/2 servers by using
2515+ the ` enableConnectProtocol ` setting:
2516+
2517+ ``` js
2518+ const http2 = require (' http2' );
2519+ const settings = { enableConnectProtocol: true };
2520+ const server = http2 .createServer ({ settings });
2521+ ```
2522+
2523+ Once the client receives the ` SETTINGS ` frame from the server indicating that
2524+ the extended CONNECT may be used, it may send ` CONNECT ` requests that use the
2525+ ` ':protocol' ` HTTP/2 pseudo-header:
2526+
2527+ ``` js
2528+ const http2 = require (' http2' );
2529+ const client = http2 .connect (' http://localhost:8080' );
2530+ client .on (' remoteSettings' , (settings ) => {
2531+ if (settings .enableConnectProtocol ) {
2532+ const req = client .request ({ ' :method' : ' CONNECT' , ' :protocol' : ' foo' });
2533+ // ...
2534+ }
2535+ });
2536+ ```
2537+
25042538## Compatibility API
25052539
25062540The Compatibility API has the goal of providing a similar developer experience
@@ -3361,6 +3395,7 @@ following additional properties:
33613395[ Readable Stream ] : stream.html#stream_class_stream_readable
33623396[ RFC 7838 ] : https://tools.ietf.org/html/rfc7838
33633397[ RFC 8336 ] : https://tools.ietf.org/html/rfc8336
3398+ [ RFC 8441 ] : https://tools.ietf.org/html/rfc8441
33643399[ Using `options.selectPadding()` ] : #http2_using_options_selectpadding
33653400[ `'checkContinue'` ] : #http2_event_checkcontinue
33663401[ `'request'` ] : #http2_event_request
0 commit comments