Skip to content

Commit 6e2ffc0

Browse files
committed
doc: document http agent options property
1 parent 2d6cbea commit 6e2ffc0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎doc/api/http.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,21 @@ options.agent = keepAliveAgent;
230230
http.request(options, onResponseCallback);
231231
```
232232

233+
### `agent.options`
234+
235+
<!-- YAML
236+
added: v0.3.4
237+
-->
238+
239+
* {Object}
240+
241+
The options used by the agent when creating new connections. This is a shallow
242+
copy of the `options` argument passed to the [`Agent`][] constructor, with
243+
agent defaults and normalizations applied.
244+
245+
For example, [`http.globalAgent.options`][] can be used as the base options
246+
when creating another [`Agent`][] instance with additional custom settings.
247+
233248
### `agent.createConnection(options[, callback])`
234249

235250
<!-- YAML
@@ -4701,6 +4716,7 @@ const agent2 = new http.Agent({ proxyEnv: process.env });
47014716
[`http.Server`]: #class-httpserver
47024717
[`http.createServer()`]: #httpcreateserveroptions-requestlistener
47034718
[`http.get()`]: #httpgetoptions-callback
4719+
[`http.globalAgent.options`]: #agentoptions
47044720
[`http.globalAgent`]: #httpglobalagent
47054721
[`http.request()`]: #httprequestoptions-callback
47064722
[`http.setGlobalProxyFromEnv()`]: #httpsetglobalproxyfromenvproxyenv

0 commit comments

Comments
 (0)