事件:'unknownProtocol'
🌐 Event: 'unknownProtocol'
socket<stream.Duplex>
当连接的客户端无法协商允许的协议(即 HTTP/2 或 HTTP/1.1)时,会触发 'unknownProtocol' 事件。事件处理程序将接收套接字以进行处理。如果没有为此事件注册监听器,连接将被终止。可以使用传递给 http2.createSecureServer() 的 'unknownProtocolTimeout' 选项指定超时时间。请参阅 兼容性接口。
🌐 The 'unknownProtocol' event is emitted when a connecting client fails to
negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler
receives the socket for handling. If no listener is registered for this event,
the connection is terminated. A timeout may be specified using the
'unknownProtocolTimeout' option passed to http2.createSecureServer().
See the Compatibility API.