Skip to content

Commit 38a5715

Browse files
lpincadanielleadams
authored andcommitted
doc: avoid using deprecated connection property
`request.connection` and `response.connection` are deprecated. Use `request.socket` and `response.socket` instead. PR-URL: #35439 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Pranshu Srivastava <rexagod@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 7bbf8ee commit 38a5715

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

doc/api/http.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,7 @@ added: v0.3.0
923923

924924
Reference to the underlying socket. Usually users will not want to access
925925
this property. In particular, the socket will not emit `'readable'` events
926-
because of how the protocol parser attaches to the socket. The `socket`
927-
may also be accessed via `request.connection`.
926+
because of how the protocol parser attaches to the socket.
928927

929928
```js
930929
const http = require('http');
@@ -1154,7 +1153,7 @@ This event is emitted when a new TCP stream is established. `socket` is
11541153
typically an object of type [`net.Socket`][]. Usually users will not want to
11551154
access this event. In particular, the socket will not emit `'readable'` events
11561155
because of how the protocol parser attaches to the socket. The `socket` can
1157-
also be accessed at `request.connection`.
1156+
also be accessed at `request.socket`.
11581157

11591158
This event can also be explicitly emitted by users to inject connections
11601159
into the HTTP server. In that case, any [`Duplex`][] stream can be passed.
@@ -1655,8 +1654,7 @@ added: v0.3.0
16551654
Reference to the underlying socket. Usually users will not want to access
16561655
this property. In particular, the socket will not emit `'readable'` events
16571656
because of how the protocol parser attaches to the socket. After
1658-
`response.end()`, the property is nulled. The `socket` may also be accessed
1659-
via `response.connection`.
1657+
`response.end()`, the property is nulled.
16601658

16611659
```js
16621660
const http = require('http');
@@ -2056,7 +2054,7 @@ added: v0.5.9
20562054
* `callback` {Function}
20572055
* Returns: {http.IncomingMessage}
20582056

2059-
Calls `message.connection.setTimeout(msecs, callback)`.
2057+
Calls `message.socket.setTimeout(msecs, callback)`.
20602058

20612059
### `message.socket`
20622060
<!-- YAML

0 commit comments

Comments
 (0)