-
Well, I couldn't know if it's a bug or an undocumented option. It ignores the proxy agent when you set Code to reproducelet result = await got("https://whatismyip.host/");
const $ = cheerio.load(result.body);
const ip = $("#ipv4address").text();
console.log("original ip ", IP); // this logs my current Ip
const agent = tunnel.httpsOverHttp({
proxy: {
host: host, // host and port
port: port,
proxyAuth: 'a password' // did try with auth and without auth
}
});
const headers = {
'user-agent': userAgent.toString(),
...defaultHeaders,
...securityHeaders
};
const jar = new CookieJar();
const result = await got("https://www.amazon.com/", {
agent: {
https: agent,
http: agent
},
cookieJar: jar,
timeout: 25000,
headers,
htttp2:true
});
const $ = cheerio.load(result.body);
const ip = $("#ipv4address").text();
console.log(`Ip with proxy : ${currentProxy} => ${ip}`); // I expect a different IP here but get the same IP as before |
Beta Was this translation helpful? Give feedback.
Answered by
szmarczak
May 4, 2021
Replies: 2 comments 2 replies
-
Instead of |
Beta Was this translation helpful? Give feedback.
0 replies
-
Also HTTP/1 agents are incompatible with HTTP/2. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
3ldar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also HTTP/1 agents are incompatible with HTTP/2.