Skip to main content
AgentOptions - node__http.d.ts - Node documentation
interface AgentOptions
extends Partial<TcpSocketConnectOpts>

Usage in Deno

```typescript import { type AgentOptions } from "node:node__http.d.ts"; ```

Properties

optional
keepAlive: boolean | undefined
Keep sockets around in a pool to be used by other requests in the future. Default = false
optional
keepAliveMsecs: number | undefined
When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. Only relevant if keepAlive is set to true.
optional
maxSockets: number | undefined
Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
optional
maxTotalSockets: number | undefined
Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
optional
maxFreeSockets: number | undefined
Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
optional
timeout: number | undefined
Socket timeout in milliseconds. This will set the timeout after the socket is connected.
optional
scheduling:
"fifo"
| "lifo"
| undefined
Scheduling strategy to apply when picking the next free socket to use.