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: clarify IncomingMessage is a new Readable "forked" from the socket #36641

Merged
merged 1 commit into from
Dec 30, 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
9 changes: 9 additions & 0 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,10 @@ the request body should be sent.
<!-- YAML
added: v0.1.17
changes:
- version: v15.5.0
pr-url: https://github.com/nodejs/node/pull/33035
description: The `destroyed` value returns `true` after the incoming data
is consumed.
- version:
- v13.1.0
- v12.16.0
Expand All @@ -1920,6 +1924,11 @@ An `IncomingMessage` object is created by [`http.Server`][] or
and [`'response'`][] event respectively. It may be used to access response
status, headers and data.

Different from it's `socket` value which is a subclass of {stream.Duplex}, the
`IncomingMessage` itself extends {stream.Readable} and is created separately to
parse and emit the incoming HTTP headers and payload, as the underlying socket
may be reused multiple times in case of keep-alive.

### Event: `'aborted'`
<!-- YAML
added: v0.3.8
Expand Down