Session pool and transport configuration
OptionalsessionTTLMs?: numberOptionalpingIntervalMs?: numberOptionalmaxSessions?: numberOptionalstrict?: booleanOptionalonDroppedHeader?: (name: string, value: string) => voidOptionalca?: string | string[]CA certificate(s) to trust in addition to the system store (private PKIs, self-signed test servers).
OptionalconnectTimeoutMs?: numberHTTP/2 connection (CONNECT) timeout in ms. Default: 30 000
OptionalrequestTimeoutMs?: numberHTTP/2 per-stream request timeout in ms. Default: 30 000
Optionalhttp1KeepAlive?: booleanReuse TCP sockets on the legacy node:https path. Default: true
Optionalhttp1MaxSockets?: numberMax idle sockets retained by the legacy keep-alive agent. Default: 16
Optionalproxy?: ProxyConfigRoute every connection through this HTTP(S) proxy using CONNECT.
Node.js only.
Send a request via HTTP/2 with automatic fallback to HTTP/1.1.
For HTTPS URLs, attempts HTTP/2 first. If the server doesn't support HTTP/2 (ALPN negotiation fails), falls back to HTTP/1.1 via fetch(). Non-HTTPS URLs or explicit HTTP/1.1 preference skip straight to fallback.
Fully resolved request
Raw response from the server
Close all cached HTTP/2 sessions and their ping timers.
Node.js HTTP/2 transport using
node:http2. Automatically falls back to HTTP/1.1 for non-HTTPS URLs or servers that don't support HTTP/2.Only loaded when running in Node.js. In all other runtimes the FetchTransport is used instead.