| 30 | const dispatcher = proxyAgent instanceof HttpsProxyAgent ? new ProxyAgent({ |
| 31 | uri: proxyAgent.proxy.href, |
| 32 | token: proxyAgent.proxy.username || proxyAgent.proxy.password |
| 33 | ? `Basic ${Buffer.from(`${decodeURIComponent(proxyAgent.proxy.username)}:${decodeURIComponent(proxyAgent.proxy.password)}`).toString('base64')}` |
| 34 | : undefined, |
| 35 | requestTls: { ...proxyAgent.options, timeout: PROXY_CONNECT_TIMEOUT_MS }, |
| 36 | proxyTls: { ...proxyAgent.connectOpts, timeout: PROXY_CONNECT_TIMEOUT_MS }, |
| 37 | clientFactory: (origin, options) => new Pool(origin, { ...options, headersTimeout: PROXY_CONNECT_TIMEOUT_MS }) |
| 38 | }) : new Agent({ |
| 39 | connect: async (options, callback) => { |
| 40 | let socket; |