Skip to content

Commit 6cd9ea8

Browse files
pimterrycodebytere
authored andcommitted
doc: document the connection event for HTTP2 & TLS servers
PR-URL: #34531 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent a340587 commit 6cd9ea8

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

doc/api/http2.md

+28
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,20 @@ the request body.
17271727
When this event is emitted and handled, the [`'request'`][] event will
17281728
not be emitted.
17291729

1730+
### Event: `'connection'`
1731+
<!-- YAML
1732+
added: v8.4.0
1733+
-->
1734+
1735+
* `socket` {stream.Duplex}
1736+
1737+
This event is emitted when a new TCP stream is established. `socket` is
1738+
typically an object of type [`net.Socket`][]. Usually users will not want to
1739+
access this event.
1740+
1741+
This event can also be explicitly emitted by users to inject connections
1742+
into the HTTP server. In that case, any [`Duplex`][] stream can be passed.
1743+
17301744
#### Event: `'request'`
17311745
<!-- YAML
17321746
added: v8.4.0
@@ -1888,6 +1902,20 @@ the request body.
18881902
When this event is emitted and handled, the [`'request'`][] event will
18891903
not be emitted.
18901904

1905+
### Event: `'connection'`
1906+
<!-- YAML
1907+
added: v8.4.0
1908+
-->
1909+
1910+
* `socket` {stream.Duplex}
1911+
1912+
This event is emitted when a new TCP stream is established, before the TLS
1913+
handshake begins. `socket` is typically an object of type [`net.Socket`][].
1914+
Usually users will not want to access this event.
1915+
1916+
This event can also be explicitly emitted by users to inject connections
1917+
into the HTTP server. In that case, any [`Duplex`][] stream can be passed.
1918+
18911919
#### Event: `'request'`
18921920
<!-- YAML
18931921
added: v8.4.0

doc/api/tls.md

+15
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,20 @@ added: v0.3.2
379379

380380
Accepts encrypted connections using TLS or SSL.
381381

382+
### Event: `'connection'`
383+
<!-- YAML
384+
added: v0.3.2
385+
-->
386+
387+
* `socket` {stream.Duplex}
388+
389+
This event is emitted when a new TCP stream is established, before the TLS
390+
handshake begins. `socket` is typically an object of type [`net.Socket`][].
391+
Usually users will not want to access this event.
392+
393+
This event can also be explicitly emitted by users to inject connections
394+
into the TLS server. In that case, any [`Duplex`][] stream can be passed.
395+
382396
### Event: `'keylog'`
383397
<!-- YAML
384398
added:
@@ -1981,6 +1995,7 @@ where `secureSocket` has the same API as `pair.cleartext`.
19811995
[`SSL_export_keying_material`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html
19821996
[`SSL_get_version`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html
19831997
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
1998+
[`Duplex`]: stream.html#stream_class_stream_duplex
19841999
[`net.createServer()`]: net.html#net_net_createserver_options_connectionlistener
19852000
[`net.Server.address()`]: net.html#net_server_address
19862001
[`net.Server`]: net.html#net_class_net_server

0 commit comments

Comments
 (0)