Integrations · Automation & scraping

Use HProxy with Puppeteer.

Run headless Chrome through an HProxy proxy with Puppeteer and page.authenticate.

Puppeteer drives headless (or headful) Chrome from Node, the go-to for rendering-heavy scraping and automated testing in the JavaScript world.

Headless Chrome from a datacenter IP is a fingerprint sites recognise on sight. A residential exit removes the network half of that tell so the browser's behaviour is what gets judged.

Setting up HProxy in Puppeteer

  1. 1.Launch Chrome with --proxy-server pointing at your host and port.
  2. 2.Because the proxy needs a login, call page.authenticate() with your username and password before navigating.
  3. 3.Navigate as normal; the whole page load now goes through the proxy.
import puppeteer from "puppeteer";

const browser = await puppeteer.launch({
  args: ["--proxy-server=res.hproxy.com:8080"],
});
const page = await browser.newPage();
await page.authenticate({ username: "user-country-us", password: "pass" });
await page.goto("https://ipinfo.io/json");

Worth knowing

The username and password go through page.authenticate(), not the --proxy-server flag.

The host, port and login shown here are the format; your exact values are on your dashboard, ready to copy.

HProxy.

Ready when you are.Your dashboard is ten seconds away.

Get Startedor talk to us at support@hproxy.com
HProxy