Interface DispatchHandler
interface DispatchHandler {
onBodySent?(chunk: Buffer): void;
onRequestSent?(): void;
onRequestStart?(controller: DispatchController, context: any): void;
onRequestUpgrade?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
socket: Duplex,
): void;
onResponseData?(controller: DispatchController, chunk: Buffer): void;
onResponseEnd?(
controller: DispatchController,
trailers: IncomingHttpHeaders,
): void;
onResponseError?(controller: DispatchController, error: Error): void;
onResponseStart?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
statusMessage?: string,
): void;
onResponseStarted?(): void;
}Methods§
§onBodySent?(chunk: Buffer): void
onBodySent?(chunk: Buffer): void
§onRequestSent?(): void
onRequestSent?(): void
Invoked after the request body is fully sent.
§onRequestStart?(controller: DispatchController, context: any): void
onRequestStart?(controller: DispatchController, context: any): void
§onRequestUpgrade?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
socket: Duplex,
): void
onRequestUpgrade?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
socket: Duplex,
): void
§onResponseData?(controller: DispatchController, chunk: Buffer): void
onResponseData?(controller: DispatchController, chunk: Buffer): void
§onResponseEnd?(
controller: DispatchController,
trailers: IncomingHttpHeaders,
): void
onResponseEnd?(
controller: DispatchController,
trailers: IncomingHttpHeaders,
): void
§onResponseError?(controller: DispatchController, error: Error): void
onResponseError?(controller: DispatchController, error: Error): void
§onResponseStart?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
statusMessage?: string,
): void
onResponseStart?(
controller: DispatchController,
statusCode: number,
headers: IncomingHttpHeaders,
statusMessage?: string,
): void
§onResponseStarted?(): void
onResponseStarted?(): void
Invoked when response is received, before headers have been read. *
Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests