diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2020-10-01 11:43:13 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2020-10-06 19:16:05 +0300 |
commit | 38a5715c1ab23ff3bfde6f5ecc5fc0995d8209f0 (patch) | |
tree | 454e19c139acc1d971e6ce68cdc6195d10340671 /doc | |
parent | 7bbf8ee2566d34eb3270ccfef5ba0fa1d89324a2 (diff) |
doc: avoid using deprecated connection property
`request.connection` and `response.connection` are deprecated. Use
`request.socket` and `response.socket` instead.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/http.md | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 9b48d18dff5..79af82c1352 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -923,8 +923,7 @@ added: v0.3.0 Reference to the underlying socket. Usually users will not want to access this property. In particular, the socket will not emit `'readable'` events -because of how the protocol parser attaches to the socket. The `socket` -may also be accessed via `request.connection`. +because of how the protocol parser attaches to the socket. ```js const http = require('http'); @@ -1154,7 +1153,7 @@ 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. In particular, the socket will not emit `'readable'` events because of how the protocol parser attaches to the socket. The `socket` can -also be accessed at `request.connection`. +also be accessed at `request.socket`. 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. @@ -1655,8 +1654,7 @@ added: v0.3.0 Reference to the underlying socket. Usually users will not want to access this property. In particular, the socket will not emit `'readable'` events because of how the protocol parser attaches to the socket. After -`response.end()`, the property is nulled. The `socket` may also be accessed -via `response.connection`. +`response.end()`, the property is nulled. ```js const http = require('http'); @@ -2056,7 +2054,7 @@ added: v0.5.9 * `callback` {Function} * Returns: {http.IncomingMessage} -Calls `message.connection.setTimeout(msecs, callback)`. +Calls `message.socket.setTimeout(msecs, callback)`. ### `message.socket` <!-- YAML |