TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
873 stars 228 forks source link

Property 'maxTotalSockets' is missing in type 'HttpsProxyAgent' #114

Closed dobromyslov closed 3 years ago

dobromyslov commented 3 years ago

Type 'HttpsProxyAgent' is not assignable to type 'Agent | ((parsedUrl: URL) => Agent)'.   Property 'maxTotalSockets' is missing in type 'HttpsProxyAgent' but required in type 'Agent'.

Therefore it's impossible to assign HttpsProxyAgent to the node-fetch's agent.

dobromyslov commented 3 years ago

Added new issue to the HttpsProxyAgent https://github.com/TooTallNate/node-agent-base/issues/48 HttpsProxyAgent should update agent-base package after it's fixed.

dobromyslov commented 3 years ago

Workaround:

import { Agent } from 'https';
const agent = new HttpsProxyAgent(this.proxyUrl) as unknown as Agent;