Skip to content

Commit

Permalink
doc: document the connection event for HTTP2 & TLS servers
Browse files Browse the repository at this point in the history
PR-URL: #34531
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
pimterry authored and codebytere committed Aug 5, 2020
1 parent a340587 commit 6cd9ea8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,20 @@ the request body.
When this event is emitted and handled, the [`'request'`][] event will
not be emitted.

### Event: `'connection'`
<!-- YAML
added: v8.4.0
-->

* `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'`
<!-- YAML
added: v8.4.0
Expand Down Expand Up @@ -1888,6 +1902,20 @@ the request body.
When this event is emitted and handled, the [`'request'`][] event will
not be emitted.

### Event: `'connection'`
<!-- YAML
added: v8.4.0
-->

* `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'`
<!-- YAML
added: v8.4.0
Expand Down
15 changes: 15 additions & 0 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,20 @@ added: v0.3.2

Accepts encrypted connections using TLS or SSL.

### Event: `'connection'`
<!-- YAML
added: v0.3.2
-->

* `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'`
<!-- YAML
added:
Expand Down Expand Up @@ -1981,6 +1995,7 @@ where `secureSocket` has the same API as `pair.cleartext`.
[`SSL_export_keying_material`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html
[`SSL_get_version`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
[`Duplex`]: stream.html#stream_class_stream_duplex
[`net.createServer()`]: net.html#net_net_createserver_options_connectionlistener
[`net.Server.address()`]: net.html#net_server_address
[`net.Server`]: net.html#net_class_net_server
Expand Down

0 comments on commit 6cd9ea8

Please sign in to comment.