Integrations / Browser automation
Use Proxys with Puppeteer
Run Puppeteer through Proxys.
Steps
- Pass --proxy-server when launching.
- Call page.authenticate with the sub-user's credentials.
const browser = await puppeteer.launch({ args: ["--proxy-server=http://gw.proxys.co:8000"] });
const page = await browser.newPage();
await page.authenticate({ username: "USERNAME-country-us", password: "PASSWORD" });
await page.goto("https://ipinfo.io/json");Before you start
Replace USERNAME and PASSWORD with a sub-user's credentials from the dashboard. Change -country-us to the country you need, or remove it for a random location. See targeting options for city, ASN and sticky sessions.