kinetex - v1.0.0-rc.1
    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

    Constructors

    Methods

    Constructors

    • Parameters

      • options: {
            sessionTTLMs?: number;
            pingIntervalMs?: number;
            maxSessions?: number;
            strict?: boolean;
            onDroppedHeader?: (name: string, value: string) => void;
            connectTimeoutMs?: number;
            requestTimeoutMs?: number;
        } = {}

        Session pool and transport configuration

        • OptionalsessionTTLMs?: number
        • OptionalpingIntervalMs?: number
        • OptionalmaxSessions?: number
        • Optionalstrict?: boolean
        • OptionalonDroppedHeader?: (name: string, value: string) => void
        • 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

      Returns NodeHTTP2Transport

    Methods

    • 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