Type Alias AgentOptions

Source
Expand description

Agent configuration. All options have undici-compatible defaults.

type AgentOptions = {
    allowH2?: boolean;
    bodyTimeout?: number;
    connectTimeout?: number;
    headersTimeout?: number;
    keepAliveTimeout?: number;
    localAddress?: string;
    maxBufferedRequestBodyBytes?: number;
    maxRedirections?: number;
    maxResponseSize?: number;
    proxy?: ProxyOptions;
    tls?: TlsOptions;
}

Properties§

allowH2

Allow HTTP/2.

bodyTimeout

Time to wait between body chunks.

connectTimeout

TCP connect timeout.

headersTimeout

Time to wait for response headers.

keepAliveTimeout

Idle keep-alive timeout.

localAddress

Source IP for outgoing connections.

maxBufferedRequestBodyBytes

Cap on buffered Node Readable request bodies in bytes.

maxRedirections

Max redirect hops. Default is 0 to match undici. fetch() performs its own redirect handling; raw request()/dispatch() callers must set this to follow redirects.

maxResponseSize

Cap on decoded body in bytes.

proxy

Proxy configuration.

tls

TLS settings.