summaryrefslogtreecommitdiff
path: root/doc/api/http.md
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-03-03 12:28:17 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-06 00:11:27 +0100
commit8a291a8e83313c42cc8c755a4d3125c6c07a1322 (patch)
tree5917c04dae20ce688d05cd622484fef16f12d048 /doc/api/http.md
parente96ac8434a037e3795af713d2153e13381206f2d (diff)
downloadandroid-node-v8-8a291a8e83313c42cc8c755a4d3125c6c07a1322.tar.gz
android-node-v8-8a291a8e83313c42cc8c755a4d3125c6c07a1322.tar.bz2
android-node-v8-8a291a8e83313c42cc8c755a4d3125c6c07a1322.zip
doc: clarify http.Agent constructor options
PR-URL: https://github.com/nodejs/node/pull/26412 Fixes: https://github.com/nodejs/node/issues/26357 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r--doc/api/http.md10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index 4eef4cf3d8..8a9d9bafda 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -116,13 +116,19 @@ added: v0.3.4
Can have the following fields:
* `keepAlive` {boolean} Keep sockets around even when there are no
outstanding requests, so they can be used for future requests without
- having to reestablish a TCP connection. **Default:** `false`.
+ having to reestablish a TCP connection. Not to be confused with the
+ `keep-alive` value of the `Connection` header. The `Connection: keep-alive`
+ header is always sent when using an agent except when the `Connection`
+ header is explicitly specified or when the `keepAlive` and `maxSockets`
+ options are respectively set to `false` and `Infinity`, in which case
+ `Connection: close` will be used. **Default:** `false`.
* `keepAliveMsecs` {number} When using the `keepAlive` option, specifies
the [initial delay](net.html#net_socket_setkeepalive_enable_initialdelay)
for TCP Keep-Alive packets. Ignored when the
`keepAlive` option is `false` or `undefined`. **Default:** `1000`.
* `maxSockets` {number} Maximum number of sockets to allow per
- host. **Default:** `Infinity`.
+ host. Each request will use a new socket until the maximum is reached.
+ **Default:** `Infinity`.
* `maxFreeSockets` {number} Maximum number of sockets to leave open
in a free state. Only relevant if `keepAlive` is set to `true`.
**Default:** `256`.