kinetex - v1.4.0
    Preparing search index...

    Class NodeHTTP2Transport

    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.

    Implements

    • Transport
    Index
    • Parameters

      • options: {
            sessionTTLMs?: number;
            pingIntervalMs?: number;
            maxSessions?: number;
            strict?: boolean;
            onDroppedHeader?: (name: string, value: string) => void;
            ca?: string | string[];
            connectTimeoutMs?: number;
            requestTimeoutMs?: number;
            http1KeepAlive?: boolean;
            http1MaxSockets?: number;
            proxy?: ProxyConfig;
        } = {}

        Session pool and transport configuration

        • OptionalsessionTTLMs?: number
        • OptionalpingIntervalMs?: number
        • OptionalmaxSessions?: number
        • Optionalstrict?: boolean
        • OptionalonDroppedHeader?: (name: string, value: string) => void
        • Optionalca?: string | string[]

          CA certificate(s) to trust in addition to the system store (private PKIs, self-signed test servers).

        • OptionalconnectTimeoutMs?: number

          HTTP/2 connection (CONNECT) timeout in ms. Default: 30 000

        • OptionalrequestTimeoutMs?: number

          HTTP/2 per-stream request timeout in ms. Default: 30 000

        • Optionalhttp1KeepAlive?: boolean

          Reuse TCP sockets on the legacy node:https path. Default: true

        • Optionalhttp1MaxSockets?: number

          Max idle sockets retained by the legacy keep-alive agent. Default: 16

        • Optionalproxy?: ProxyConfig

          Route every connection through this HTTP(S) proxy using CONNECT. Node.js only.

      Returns NodeHTTP2Transport

    • 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.

      Parameters

      Returns Promise<RawResponse>

      Raw response from the server

    • Close all cached HTTP/2 sessions and their ping timers.

      Returns void