Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c56a291

Browse filesBrowse files
pimterryaddaleax
authored andcommitted
doc: document the connection event for HTTP2 & TLS servers
PR-URL: #34531 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 95e0f8e commit c56a291
Copy full SHA for c56a291

File tree

Expand file treeCollapse file tree

2 files changed

+43
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+43
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/http2.md‎

Copy file name to clipboardExpand all lines: doc/api/http2.md
+28Lines changed: 28 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,20 @@ the request body.
17141714
When this event is emitted and handled, the [`'request'`][] event will
17151715
not be emitted.
17161716

1717+
### Event: `'connection'`
1718+
<!-- YAML
1719+
added: v8.4.0
1720+
-->
1721+
1722+
* `socket` {stream.Duplex}
1723+
1724+
This event is emitted when a new TCP stream is established. `socket` is
1725+
typically an object of type [`net.Socket`][]. Usually users will not want to
1726+
access this event.
1727+
1728+
This event can also be explicitly emitted by users to inject connections
1729+
into the HTTP server. In that case, any [`Duplex`][] stream can be passed.
1730+
17171731
#### Event: `'request'`
17181732
<!-- YAML
17191733
added: v8.4.0
@@ -1854,6 +1868,20 @@ the request body.
18541868
When this event is emitted and handled, the [`'request'`][] event will
18551869
not be emitted.
18561870

1871+
### Event: `'connection'`
1872+
<!-- YAML
1873+
added: v8.4.0
1874+
-->
1875+
1876+
* `socket` {stream.Duplex}
1877+
1878+
This event is emitted when a new TCP stream is established, before the TLS
1879+
handshake begins. `socket` is typically an object of type [`net.Socket`][].
1880+
Usually users will not want to access this event.
1881+
1882+
This event can also be explicitly emitted by users to inject connections
1883+
into the HTTP server. In that case, any [`Duplex`][] stream can be passed.
1884+
18571885
#### Event: `'request'`
18581886
<!-- YAML
18591887
added: v8.4.0
Collapse file

‎doc/api/tls.md‎

Copy file name to clipboardExpand all lines: doc/api/tls.md
+15Lines changed: 15 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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: v12.3.0
@@ -1959,6 +1973,7 @@ where `secureSocket` has the same API as `pair.cleartext`.
19591973
[`SSL_export_keying_material`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html
19601974
[`SSL_get_version`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html
19611975
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
1976+
[`Duplex`]: stream.html#stream_class_stream_duplex
19621977
[`net.createServer()`]: net.html#net_net_createserver_options_connectionlistener
19631978
[`net.Server.address()`]: net.html#net_server_address
19641979
[`net.Server`]: net.html#net_class_net_server

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.