1 |
|
2 | import * as http from 'http';
|
3 | import LRUCache from 'lru-cache';
|
4 | import { Agent, AgentConnectOpts } from 'agent-base';
|
5 | import { PacProxyAgentOptions } from 'pac-proxy-agent';
|
6 | import { HttpProxyAgentOptions } from 'http-proxy-agent';
|
7 | import { HttpsProxyAgentOptions } from 'https-proxy-agent';
|
8 | import { SocksProxyAgentOptions } from 'socks-proxy-agent';
|
9 | declare const PROTOCOLS: readonly ["http", "https", "socks", "socks4", "socks4a", "socks5", "socks5h", ...("pac-http" | "pac-https" | "pac-data" | "pac-file" | "pac-ftp")[]];
|
10 | type ValidProtocol = (typeof PROTOCOLS)[number];
|
11 |
|
12 |
|
13 |
|
14 | export declare const proxies: {
|
15 | [P in ValidProtocol]: new (...args: never[]) => Agent;
|
16 | };
|
17 | export type ProxyAgentOptions = HttpProxyAgentOptions<''> & HttpsProxyAgentOptions<''> & SocksProxyAgentOptions & PacProxyAgentOptions<''> & {
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | httpAgent?: http.Agent;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 | httpsAgent?: http.Agent;
|
30 | };
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare class ProxyAgent extends Agent {
|
39 | |
40 |
|
41 |
|
42 | cache: LRUCache<string, Agent>;
|
43 | connectOpts?: ProxyAgentOptions;
|
44 | httpAgent: http.Agent;
|
45 | httpsAgent: http.Agent;
|
46 | constructor(opts?: ProxyAgentOptions);
|
47 | connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<http.Agent>;
|
48 | destroy(): void;
|
49 | }
|
50 | export {};
|
51 |
|
\ | No newline at end of file |