Skip to content

HttpAgentOptions

HttpAgentOptions = object

Defined in: packages/net-http/src/client/http-agent.ts:53

Construction options for HttpAgent. Every limit is required.

readonly connector: Connector

Defined in: packages/net-http/src/client/http-agent.ts:55

Opens connections; connectTcp from @ac-kit/net-transport-node.


readonly optional http2?: HttpAgentHttp2Options

Defined in: packages/net-http/src/client/http-agent.ts:77

Use HTTP/2 with these limits where the server accepts it: offered through ALPN to https: origins, and spoken to http: origins with priorKnowledge. Absent, every connection is HTTP/1.1.


readonly optional http3?: HttpAgentHttp3Options

Defined in: packages/net-http/src/client/http-agent.ts:85

Reach https: origins over HTTP/3 with these limits: those that advertised it in an Alt-Svc response field (RFC 7838), or every one with priorKnowledge. A protocol switch the server does not accept over HTTP/3 still goes over HTTP/1.1, through connector.


readonly idleTimeoutMs: number

Defined in: packages/net-http/src/client/http-agent.ts:70

How long, in milliseconds, an unused connection is kept for reuse; an HTTP/2 connection is unused once no stream is open on it.


readonly maxConnectionsPerOrigin: number

Defined in: packages/net-http/src/client/http-agent.ts:64

Connections open at once to one origin. A request finding them all busy waits for one to free up.


readonly maxHeadSize: number

Defined in: packages/net-http/src/client/http-agent.ts:58

Largest response head accepted, in bytes.