Options for Agent constructor.

Fields

@:optionaloptionaltimeout:Null<Int>

Socket timeout in milliseconds. This will set the timeout when the socket is created.

@:optionaloptionalmaxSockets:Null<Int>

Maximum number of sockets to allow per host. Each request will use a new socket until the maximum is reached.

Default: Infinity.

@:optionaloptionalmaxFreeSockets:Null<Int>

Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true.

Default: 256.

@:optionaloptionalkeepAliveMsecs:Null<Int>

When using the keepAlive option, specifies the initial delay for TCP Keep-Alive packets. Ignored when the keepAlive option is false or undefined.

Default: 1000.

@:optionaloptionalkeepAlive:Null<Bool>

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. 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