Use ProxyHQ with Puppeteer
Run Puppeteer through ProxyHQ.
Connection details
Use these values. Your login and password are in your dashboard.
| Type | HTTP (or SOCKS5) |
| Host | gw.proxyhq.net |
| Port (HTTP / HTTPS) | 823 |
| Port (SOCKS5) | 824 |
| Sticky ports | 10000 - 20000 |
| Username | YOUR_LOGIN |
| Password | YOUR_PASSWORD |
Steps
- Start the browser with the --proxy-server argument. Chrome does not accept a login in this argument.
- Give the login with page.authenticate before you open a page.
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({
args: ["--proxy-server=http://gw.proxyhq.net:823"],
});
const page = await browser.newPage();
await page.authenticate({
username: "YOUR_LOGIN__cr.us",
password: "YOUR_PASSWORD",
});
await page.goto("https://api.ipify.org");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();Choose a country or a sticky IP
Add __cr.de (or another country code) to the end of your login to choose a country. Use a port from 10000 to 20000 for a sticky IP. See country targeting and rotating vs sticky.
Stuck? See troubleshooting or email [email protected].