TooTallNate / proxy-agents

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

Cache Access Denied #230

Closed programerr01 closed 11 months ago

programerr01 commented 11 months ago

When trying to use authenticated proxy server , it gives cache access denied

authenticate yourself the headers are taken from browser based automation from puppeter for same proxy server

but it's not working when used with http request with axios , the request looks like this

 const HttpsProxyAgent = require("https-proxy-agent");
 var axios = require("axios");

const httpsAgent = new HttpsProxyAgent({host: "url", port: "3120", auth: "username:password"})

var res = await axios('url',{headers,httpsAgent})
TooTallNate commented 11 months ago

Please pass a URL to the constructor instead, i.e. http://username:password@url:3120

More specifically, the property should not be auth, but instead username and password properties (which corresponds with the URL class).