Agent

external class Agent : Agent(source)

An Agent object for HTTPS similar to http.Agent. See {@link request} for more information.

Since

v0.4.5

Constructors

Link copied to clipboard
constructor(options: AgentOptions = definedExternally)

Properties

Link copied to clipboard

An object which contains arrays of sockets currently awaiting use by the agent when keepAlive is enabled. Do not modify.

Link copied to clipboard

By default set to 256. For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.

Link copied to clipboard

By default set to Infinity. Determines how many concurrent sockets the agent can have open per origin. Origin is the returned value of agent.getName().

Link copied to clipboard

By default set to Infinity. Determines how many concurrent sockets the agent can have open. Unlike maxSockets, this parameter applies across all origins.

Link copied to clipboard
Link copied to clipboard

An object which contains queues of requests that have not yet been assigned to sockets. Do not modify.

Link copied to clipboard

An object which contains arrays of sockets currently in use by the agent. Do not modify.

Functions

Link copied to clipboard
fun destroy()

Destroy any sockets that are currently in use by the agent.

Link copied to clipboard

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

Link copied to clipboard

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link defaultMaxListeners}.

Link copied to clipboard

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.