I created a module for that. It's very simple to use, First install it:
npm i puppeteer-page-proxy
Then require it:
const useProxy = require('puppeteer-page-proxy');
And then simply use it. To set a proxy for an entire page, do this:
await useProxy(page, 'http://127.0.0.1:771');
Or if you want to set it per requests, just do this:
await page.setRequestInterception(true); page.on('request', req => { useProxy(req, 'socks5://127.0.0.1:9000'); });
Repository: github.com/Cuadrix/puppeteer-page-...
Hi Cuadrix, thanks for the addition. This is cool and more natural for human :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I created a module for that. It's very simple to use,
First install it:
Then require it:
And then simply use it. To set a proxy for an entire page, do this:
Or if you want to set it per requests, just do this:
Repository: github.com/Cuadrix/puppeteer-page-...
Hi Cuadrix, thanks for the addition. This is cool and more natural for human :)