From 6cd9ea82f662a2a2c1d8f072837c3c172ff0f7b7 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 27 Jul 2020 20:08:38 +0200 Subject: [PATCH] doc: document the connection event for HTTP2 & TLS servers PR-URL: https://github.com/nodejs/node/pull/34531 Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca --- doc/api/http2.md | 28 ++++++++++++++++++++++++++++ doc/api/tls.md | 15 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 48aa027992291e..6b7f002cba0a49 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1727,6 +1727,20 @@ the request body. When this event is emitted and handled, the [`'request'`][] event will not be emitted. +### Event: `'connection'` + + +* `socket` {stream.Duplex} + +This event is emitted when a new TCP stream is established. `socket` is +typically an object of type [`net.Socket`][]. Usually users will not want to +access this event. + +This event can also be explicitly emitted by users to inject connections +into the HTTP server. In that case, any [`Duplex`][] stream can be passed. + #### Event: `'request'` + +* `socket` {stream.Duplex} + +This event is emitted when a new TCP stream is established, before the TLS +handshake begins. `socket` is typically an object of type [`net.Socket`][]. +Usually users will not want to access this event. + +This event can also be explicitly emitted by users to inject connections +into the HTTP server. In that case, any [`Duplex`][] stream can be passed. + #### Event: `'request'` + +* `socket` {stream.Duplex} + +This event is emitted when a new TCP stream is established, before the TLS +handshake begins. `socket` is typically an object of type [`net.Socket`][]. +Usually users will not want to access this event. + +This event can also be explicitly emitted by users to inject connections +into the TLS server. In that case, any [`Duplex`][] stream can be passed. + ### Event: `'keylog'`