proxy-agent.d.ts 806 B

1234567891011121314151617181920212223242526272829
  1. import Agent from './agent'
  2. import buildConnector from './connector'
  3. import Dispatcher from './dispatcher'
  4. import { IncomingHttpHeaders } from './header'
  5. export default ProxyAgent
  6. declare class ProxyAgent extends Dispatcher {
  7. constructor (options: ProxyAgent.Options | string)
  8. dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
  9. close (): Promise<void>
  10. }
  11. declare namespace ProxyAgent {
  12. export interface Options extends Agent.Options {
  13. uri: string;
  14. /**
  15. * @deprecated use opts.token
  16. */
  17. auth?: string;
  18. token?: string;
  19. headers?: IncomingHttpHeaders;
  20. requestTls?: buildConnector.BuildOptions;
  21. proxyTls?: buildConnector.BuildOptions;
  22. clientFactory?(origin: URL, opts: object): Dispatcher;
  23. proxyTunnel?: boolean;
  24. }
  25. }