New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic proxy chage in page #1861
Comments
This is something we are thinking of to. Let's see how it goes. |
+1 |
+1 plz halp |
Dupe oc #678 |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
You might be able to achieve that with an extension. |
Can you use chrome extensions inside puppeteer ? |
Yes you can use extensions with puppeteer, given that extensions can be used to change proxy and that extensions can know about requests, i feel like this might be doable. |
try this PuppeteerUtil.useProxy |
@xiyuan-fengyu use |
It's possible with puppeteer-page-proxy. First install it:
Then require it: const useProxy = require('puppeteer-page-proxy'); Using it is easy; await useProxy(page, 'http://127.0.0.1:8000'); If you want a different proxy for each request,then you can simply do this: await page.setRequestInterception(true);
page.on('request', req => {
useProxy(req, 'socks5://127.0.0.1:9000');
}); Then if you want to be sure that your page's IP has changed, you can look it up; const data = await useProxy.lookup(page);
console.log(data.ip); It supports http, https, socks4 and socks5 proxies, and it also supports authentication if that is needed: const proxy = 'http://login:pass@127.0.0.1:8000' Repository: |
@Cuadrix is not working, "Provisional headers are shown" message + can't extract request cookies |
+1 |
Invalid, Getting Error: net::ERR_FAILED |
Same here. Any update on the issue? |
Thats a proxy issue. I use puppeteer-page-proxy daily and it works just fine. Use premium proxies if you want it to work. |
const browser = await puppeteer.launch({
args: ['--proxy-server='+proxy
});
So my goal is to change proxy on every request, not to have only one proxy per browser.
Thanks!
The text was updated successfully, but these errors were encountered: