index.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. /// <reference types="node" />
  2. /// <reference types="node" />
  3. /// <reference types="node" />
  4. import { SocksProxy } from 'socks';
  5. import { Agent, AgentConnectOpts } from 'agent-base';
  6. import * as net from 'net';
  7. import * as http from 'http';
  8. import { URL } from 'url';
  9. type SocksSocketOptions = Omit<net.TcpNetConnectOpts, 'port' | 'host'>;
  10. export type SocksProxyAgentOptions = Omit<SocksProxy, 'ipaddress' | 'host' | 'port' | 'type' | 'userId' | 'password'> & {
  11. socketOptions?: SocksSocketOptions;
  12. } & http.AgentOptions;
  13. export 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. }
  26. export {};
  27. //# sourceMappingURL=index.d.ts.map