-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
34 lines (31 loc) · 908 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as express from 'express';
import * as http from 'http';
declare function ExpressHttpProxy(host: string, options: ExpressHttpProxy.IOptions): express.RequestHandler;
declare namespace ExpressHttpProxy {
interface IOptions {
port?: number;
intercept?: (
rsp: http.ServerResponse,
rspData: Buffer,
req: express.Request,
res: express.Response,
callback: (err: any, rspd: string | Buffer, send?: boolean) => void
) => void;
decorateRequest?: (reqOpt: IRequestOption) => IRequestOption;
forwardPath?: (req: express.Request, res: express.Response) => string;
filter?: Function;
limit?: string;
preserveHostHdr?: boolean;
headers?: { [key: string]: any};
}
interface IRequestOption {
hostname: string;
port: number;
headers: { [key: string]: any};
method: string;
path: string;
bodyContent: string | Buffer;
params: any;
}
}
export = ExpressHttpProxy;