proxy-agent.d.ts 780 B

12345678910111213141516171819202122232425262728
  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.DispatchHandlers): 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. }
  24. }