interface Options {
    allowH2?: boolean;
    autoSelectFamily?: boolean;
    autoSelectFamilyAttemptTimeout?: number;
    bodyTimeout?: number;
    connect?: BuildOptions | connector;
    connectTimeout?: number;
    headersTimeout?: number;
    idleTimeout?: undefined;
    interceptors?: OptionsInterceptors;
    keepAlive?: undefined;
    keepAliveMaxTimeout?: number;
    keepAliveTimeout?: number;
    keepAliveTimeoutThreshold?: number;
    localAddress?: string;
    maxCachedSessions?: number;
    maxConcurrentStreams?: number;
    maxHeaderSize?: number;
    maxKeepAliveTimeout?: undefined;
    maxRedirections?: number;
    maxRequestsPerClient?: number;
    maxResponseSize?: number;
    pipelining?: number;
    requestTimeout?: undefined;
    socketPath?: string;
    socketTimeout?: undefined;
    strictContentLength?: boolean;
    tls?: undefined;
}

Hierarchy (View Summary)

Properties

allowH2?: boolean

Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.

false
autoSelectFamily?: boolean

Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305.

autoSelectFamilyAttemptTimeout?: number

The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the autoSelectFamily option.

bodyTimeout?: number

The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Default: 300e3 milliseconds (300s).

TODO

connectTimeout?: number

TODO

headersTimeout?: number

The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: 300e3 milliseconds (300s).

idleTimeout?: undefined

unsupported idleTimeout, use keepAliveTimeout instead

interceptors?: OptionsInterceptors

TODO

keepAlive?: undefined

unsupported keepAlive, use pipelining=0 instead

keepAliveMaxTimeout?: number

the maximum allowed idleTimeout, in milliseconds, when overridden by keep-alive hints from the server. Default: 600e3 milliseconds (10min).

keepAliveTimeout?: number

the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by keep-alive hints from the server. Default: 4e3 milliseconds (4s).

keepAliveTimeoutThreshold?: number

A number of milliseconds subtracted from server keep-alive hints when overriding idleTimeout to account for timing inaccuracies caused by e.g. transport latency. Default: 1e3 milliseconds (1s).

localAddress?: string

TODO

maxCachedSessions?: number

TODO

maxConcurrentStreams?: number

Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.

100
maxHeaderSize?: number

The maximum length of request headers in bytes. Default: Node.js' --max-http-header-size or 16384 (16KiB).

maxKeepAliveTimeout?: undefined

unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead

maxRedirections?: number

TODO

maxRequestsPerClient?: number

TODO

maxResponseSize?: number

Max response body size in bytes, -1 is disabled

pipelining?: number

The amount of concurrent requests to be sent over the single TCP/TLS connection according to RFC7230. Default: 1.

requestTimeout?: undefined

unsupported requestTimeout, use headersTimeout & bodyTimeout instead

socketPath?: string

TODO

socketTimeout?: undefined

unsupported socketTimeout, use headersTimeout & bodyTimeout instead

strictContentLength?: boolean

If true, an error is thrown when the request content-length header doesn't match the length of the request body. Default: true.

tls?: undefined

use the connect option instead