You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
687 B

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