TooTallNate / proxy-agents

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

Can't set jar when createCookieAgent(httpProxyAgent.HttpProxyAgent) #261

Closed TenUchikawa closed 3 months ago

TenUchikawa commented 7 months ago

Can't set jar when createCookieAgent(httpProxyAgent.HttpProxyAgent)

The type of the first argument is (string | URL) & CookieAgentOptions, so it cannot be assigned. Shouldn't the type of the first argument be the following? { url:string|URL }

const HttpProxyCookieAgent = createCookieAgent(httpProxyAgent.HttpProxyAgent);
const HttpsProxyCookieAgent = createCookieAgent(
  httpsProxyAgent.HttpsProxyAgent
);
//                       ↓
new HttpProxyCookieAgent({});
//                        ↓
new HttpsProxyCookieAgent({});
lukekarrys commented 3 months ago

http-proxy-agent should work with http-cookie-agent@>=5.0.4. The commit implementing the changes have some examples of how this would work.