@@ -1970,7 +1970,9 @@ added: v8.4.0
19701970The ` 'unknownProtocol' ` event is emitted when a connecting client fails to
19711971negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler
19721972receives the socket for handling. If no listener is registered for this event,
1973- the connection is terminated. See the [ Compatibility API] [ ] .
1973+ the connection is terminated. A timeout may be specified using the
1974+ ` 'unknownProtocolTimeout' ` option passed to [ ` http2.createSecureServer() ` ] [ ] .
1975+ See the [ Compatibility API] [ ] .
19741976
19751977#### ` server.close([callback]) `
19761978<!-- YAML
@@ -2010,6 +2012,9 @@ error will be thrown.
20102012<!-- YAML
20112013added: v8.4.0
20122014changes:
2015+ - version: REPLACEME
2016+ pr-url: https://github.com/nodejs-private/node-private/pull/250
2017+ description: Added `unknownProtocolTimeout` option with a default of 10000.
20132018 - version:
20142019 - v12.18.0
20152020 pr-url: https://github.com/nodejs-private/node-private/pull/206
@@ -2112,6 +2117,10 @@ changes:
21122117 ` Http2ServerResponse ` class to use.
21132118 Useful for extending the original ` Http2ServerResponse ` .
21142119 ** Default:** ` Http2ServerResponse ` .
2120+ * ` unknownProtocolTimeout ` {number} Specifies a timeout in milliseconds that
2121+ a server should wait when an [ ` 'unknownProtocol' ` ] [ ] is emitted. If the
2122+ socket has not been destroyed by that time the server will destroy it.
2123+ ** Default:** ` 10000 ` .
21152124 * ...: Any [ ` net.createServer() ` ] [ ] option can be provided.
21162125* ` onRequestHandler ` {Function} See [ Compatibility API] [ ]
21172126* Returns: {Http2Server}
@@ -2148,6 +2157,9 @@ server.listen(80);
21482157<!-- YAML
21492158added: v8.4.0
21502159changes:
2160+ - version: REPLACEME
2161+ pr-url: https://github.com/nodejs-private/node-private/pull/250
2162+ description: Added `unknownProtocolTimeout` option with a default of 10000.
21512163 - version:
21522164 - v12.18.0
21532165 pr-url: https://github.com/nodejs-private/node-private/pull/206
@@ -2240,6 +2252,10 @@ changes:
22402252 servers, the identity options (` pfx ` or ` key ` /` cert ` ) are usually required.
22412253 * ` origins ` {string[ ] } An array of origin strings to send within an ` ORIGIN `
22422254 frame immediately following creation of a new server ` Http2Session ` .
2255+ * ` unknownProtocolTimeout ` {number} Specifies a timeout in milliseconds that
2256+ a server should wait when an [ ` 'unknownProtocol' ` ] [ ] event is emitted. If
2257+ the socket has not been destroyed by that time the server will destroy it.
2258+ ** Default:** ` 10000 ` .
22432259* ` onRequestHandler ` {Function} See [ Compatibility API] [ ]
22442260* Returns: {Http2SecureServer}
22452261
@@ -2273,6 +2289,9 @@ server.listen(80);
22732289<!-- YAML
22742290added: v8.4.0
22752291changes:
2292+ - version: REPLACEME
2293+ pr-url: https://github.com/nodejs-private/node-private/pull/250
2294+ description: Added `unknownProtocolTimeout` option with a default of 10000.
22762295 - version:
22772296 - v12.18.0
22782297 pr-url: https://github.com/nodejs-private/node-private/pull/206
@@ -2356,6 +2375,10 @@ changes:
23562375 instance passed to ` connect ` and the ` options ` object, and returns any
23572376 [ ` Duplex ` ] [ ] stream that is to be used as the connection for this session.
23582377 * ...: Any [ ` net.connect() ` ] [ ] or [ ` tls.connect() ` ] [ ] options can be provided.
2378+ * ` unknownProtocolTimeout ` {number} Specifies a timeout in milliseconds that
2379+ a server should wait when an [ ` 'unknownProtocol' ` ] [ ] event is emitted. If
2380+ the socket has not been destroyed by that time the server will destroy it.
2381+ ** Default:** ` 10000 ` .
23592382* ` listener ` {Function} Will be registered as a one-time listener of the
23602383 [ ` 'connect' ` ] [ ] event.
23612384* Returns: {ClientHttp2Session}
0 commit comments