Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: avoid using deprecated connection property #35439

Merged
merged 1 commit into from
Oct 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,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');
Expand Down Expand Up @@ -1157,7 +1156,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.
Expand Down Expand Up @@ -1658,8 +1657,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');
Expand Down Expand Up @@ -2059,7 +2057,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
Expand Down