proxy.d.ts 959 B

1234567891011121314151617181920212223242526272829303132
  1. import type * as http from "node:http";
  2. import type * as https from "node:https";
  3. import type * as undici from "undici";
  4. export type ProxyOptions = {
  5. /**
  6. * HTTP(s) Proxy URL
  7. *
  8. * Default is read from `https_proxy`, `http_proxy`, `HTTPS_PROXY` or `HTTP_PROXY` environment variables
  9. * */
  10. url?: string;
  11. /**
  12. * List of hosts to skip proxy for (comma separated or array of strings)
  13. *
  14. * Default is read from `no_proxy` or `NO_PROXY` environment variables
  15. *
  16. * Hots starting with a leading dot, like `.foo.com` are also matched against domain and all its subdomains like `bar.foo.com`
  17. */
  18. noProxy?: string | string[];
  19. };
  20. export declare const createProxy: (opts?: ProxyOptions) => {
  21. agent: http.Agent | https.Agent | undefined;
  22. dispatcher: undici.Dispatcher | undefined;
  23. };
  24. export declare const createFetch: (
  25. proxyOptions?: ProxyOptions,
  26. ) => typeof globalThis.fetch;
  27. export declare const fetch: typeof globalThis.fetch;