Skip to content

Commit f3f67ff

Browse files
fahrradfluchtmarco-ippolito
authored andcommitted
doc: call out http(s).globalAgent default
Despite the `http.Agent` stating: > The default `http.globalAgent` that is used by `http.request()` has > all of these values set to their respective defaults. this isn't true anymore since node.js 19. Both, the http as well as the https `globalAgent` now set `{ keepAlive: true, scheduling: 'lifo', timeout: 5000 }` as options. `'lifo'` is the default anyway, but `keepAlive` is turned off and no `timeout` is set on `new Agent()`. Document the diverging behaviour in the `globalAgent` sections, remove the false statement from `http.Agent` section, and extend the changelog to call out the timeout change as well. PR-URL: #52392 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent e67bc34 commit f3f67ff

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

doc/api/http.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ changes:
180180

181181
`options` in [`socket.connect()`][] are also supported.
182182

183-
The default [`http.globalAgent`][] that is used by [`http.request()`][] has all
184-
of these values set to their respective defaults.
185-
186183
To configure any of them, a custom [`http.Agent`][] instance must be created.
187184

188185
```mjs
@@ -3652,13 +3649,15 @@ changes:
36523649
- version:
36533650
- v19.0.0
36543651
pr-url: https://github.com/nodejs/node/pull/43522
3655-
description: The agent now uses HTTP Keep-Alive by default.
3652+
description: The agent now uses HTTP Keep-Alive and a 5 second timeout by
3653+
default.
36563654
-->
36573655

36583656
* {http.Agent}
36593657

36603658
Global instance of `Agent` which is used as the default for all HTTP client
3661-
requests.
3659+
requests. Diverges from a default `Agent` configuration by having `keepAlive`
3660+
enabled and a `timeout` of 5 seconds.
36623661

36633662
## `http.maxHeaderSize`
36643663

doc/api/https.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,13 @@ changes:
327327
- version:
328328
- v19.0.0
329329
pr-url: https://github.com/nodejs/node/pull/43522
330-
description: The agent now uses HTTP Keep-Alive by default.
330+
description: The agent now uses HTTP Keep-Alive and a 5 second timeout by
331+
default.
331332
-->
332333

333-
Global instance of [`https.Agent`][] for all HTTPS client requests.
334+
Global instance of [`https.Agent`][] for all HTTPS client requests. Diverges
335+
from a default [`https.Agent`][] configuration by having `keepAlive` enabled and
336+
a `timeout` of 5 seconds.
334337

335338
## `https.request(options[, callback])`
336339

0 commit comments

Comments
 (0)