UNPKG

659 BTypeScriptView Raw
1import { Plugin } from '../../types';
2/**
3 * Implements option.on object to subscribe to http-proxy events.
4 *
5 * @example
6 * ```js
7 * createProxyMiddleware({
8 * on: {
9 * error: (error, req, res, target) => {},
10 * proxyReq: (proxyReq, req, res, options) => {},
11 * proxyReqWs: (proxyReq, req, socket, options) => {},
12 * proxyRes: (proxyRes, req, res) => {},
13 * open: (proxySocket) => {},
14 * close: (proxyRes, proxySocket, proxyHead) => {},
15 * start: (req, res, target) => {},
16 * end: (req, res, proxyRes) => {},
17 * econnreset: (error, req, res, target) => {},
18 * }
19 * });
20 * ```
21 */
22export declare const proxyEventsPlugin: Plugin;