xmpp-httpx - v0.11.0
    Preparing search index...

    Interface HttpxHandlerResponse

    interface HttpxHandlerResponse {
        body?: HttpxBodyInit;
        extensions?: Element[];
        headers?: HeadersInit;
        status?: number;
        statusMessage?: string;
        tunnel?: (tunnel: IbbDuplex) => void | Promise<void>;
    }
    Index
    extensions?: Element[]

    Elements in other namespaces to carry inside the , verbatim.

    headers?: HeadersInit
    status?: number

    Defaults to 200.

    statusMessage?: string
    tunnel?: (tunnel: IbbDuplex) => void | Promise<void>

    CONNECT only: turns a 2xx answer into a tunnel (design §4.2). The response carries no body; instead one IBB stream, opened by this server after the reply, carries bytes both ways, and this callback receives it. The library does not dial anything — the handler connects to the destination first (so it can answer 502/504 instead), then returns 2xx with this callback and pipes the two together.

    It is called exactly once for a 2xx response, and never for any other status. If the stream cannot be opened (the requester has gone, or refuses the ), it is still called, with a tunnel that is already dead: readable errors and write() rejects — so the handler's ordinary error path is also where it closes the destination socket.