interface DispatchHandler {
    onBodySent(chunkSize: number, totalBytesSent: number): void;
    onComplete(trailers: null | string[]): void;
    onConnect(abort: (err?: Error) => void): void;
    onData(chunk: Buffer<ArrayBufferLike>): boolean;
    onError(err: Error): void;
    onHeaders(
        statusCode: number,
        headers: Buffer<ArrayBufferLike>[],
        resume: () => void,
        statusText: string,
    ): boolean;
    onRequestStart(
        controller: Dispatcher.DispatchController,
        context: any,
    ): void;
    onRequestUpgrade(
        controller: Dispatcher.DispatchController,
        statusCode: number,
        headers: IncomingHttpHeaders,
        socket: Duplex,
    ): void;
    onResponseData(
        controller: Dispatcher.DispatchController,
        chunk: Buffer<ArrayBufferLike>,
    ): void;
    onResponseEnd(
        controller: Dispatcher.DispatchController,
        trailers: IncomingHttpHeaders,
    ): void;
    onResponseError(
        controller: Dispatcher.DispatchController,
        error: Error,
    ): void;
    onResponseStart(
        controller: Dispatcher.DispatchController,
        statusCode: number,
        headers: IncomingHttpHeaders,
        statusMessage?: string,
    ): void;
    onResponseStarted(): void;
    onUpgrade(
        statusCode: number,
        headers: null | string[] | Buffer<ArrayBufferLike>[],
        socket: Duplex,
    ): void;
}

Methods

  • Parameters

    • chunkSize: number
    • totalBytesSent: number

    Returns void

  • Parameters

    • trailers: null | string[]

    Returns void

  • Parameters

    • abort: (err?: Error) => void

    Returns void

  • Parameters

    Returns boolean

  • Parameters

    • err: Error

    Returns void

  • Parameters

    • statusCode: number
    • headers: Buffer<ArrayBufferLike>[]
    • resume: () => void
    • statusText: string

    Returns boolean

  • Returns void

  • Parameters

    Returns void