UNPKG

1.16 kBTypeScriptView Raw
1/// <reference types="node" />
2/// <reference types="node" />
3/// <reference types="node" />
4import { SocksProxy } from 'socks';
5import { Agent, AgentConnectOpts } from 'agent-base';
6import * as net from 'net';
7import * as http from 'http';
8import { URL } from 'url';
9type SocksSocketOptions = Omit<net.TcpNetConnectOpts, 'port' | 'host'>;
10export type SocksProxyAgentOptions = Omit<SocksProxy, 'ipaddress' | 'host' | 'port' | 'type' | 'userId' | 'password'> & {
11 socketOptions?: SocksSocketOptions;
12} & http.AgentOptions;
13export declare class SocksProxyAgent extends Agent {
14 static protocols: readonly ["socks", "socks4", "socks4a", "socks5", "socks5h"];
15 readonly shouldLookup: boolean;
16 readonly proxy: SocksProxy;
17 timeout: number | null;
18 socketOptions: SocksSocketOptions | null;
19 constructor(uri: string | URL, opts?: SocksProxyAgentOptions);
20 /**
21 * Initiates a SOCKS connection to the specified SOCKS proxy server,
22 * which in turn connects to the specified remote host and port.
23 */
24 connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
25}
26export {};
27//# sourceMappingURL=index.d.ts.map
\No newline at end of file