1 | import type * as http from 'http';
|
2 | type Interceptor<TReq = http.IncomingMessage, TRes = http.ServerResponse> = (buffer: Buffer, proxyRes: TReq, req: TReq, res: TRes) => Promise<Buffer | string>;
|
3 | /**
|
4 | * Intercept responses from upstream.
|
5 | * Automatically decompress (deflate, gzip, brotli).
|
6 | * Give developer the opportunity to modify intercepted Buffer and http.ServerResponse
|
7 | *
|
8 | * NOTE: must set options.selfHandleResponse=true (prevent automatic call of res.end())
|
9 | */
|
10 | export declare function responseInterceptor<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse>(interceptor: Interceptor<TReq, TRes>): (proxyRes: TReq, req: TReq, res: TRes) => Promise<void>;
|
11 | export {};
|