NodeLighthouse

Residential proxies with Puppeteer

Chrome takes the proxy address as a launch argument but not the credentials, so Puppeteer splits the setup in two: --proxy-server for host and port, and page.authenticate() for username and password. Browser contexts can each get their own proxy.

Your username and password are on the Proxy generator page after you sign in. Host gw.nodelighthouse.com: port 9000 rotating, 10000 sticky, 11000 SOCKS5.

Get your credentials

Your username and password are on the Proxy generator page of the dashboard. Use the password exactly as shown there; country, state, city and session options all go in the username.

As with any browser, the sticky port 10000 is usually the better fit, so all the requests behind one page load share an IP.

npm i puppeteer

Launch with --proxy-server and authenticate

Pass the gateway in --proxy-server, then call page.authenticate() on each page before navigating.

const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch({
    args: ["--proxy-server=http://gw.nodelighthouse.com:10000"],
  });
  const page = await browser.newPage();
  await page.authenticate({
    username: "<USERNAME>-type-residential-country-us-lifetime-10-session-abc12345",
    password: "<PASSWORD>",
  });
  await page.goto("https://api.ipify.org");
  console.log(await page.evaluate(() => document.body.innerText));
  await browser.close();
})();

One sticky IP per browser context

createBrowserContext() accepts a proxyServer option, so one browser can run several isolated sessions. Authenticate each page with a different session id to give each context its own IP.

const puppeteer = require("puppeteer");
const crypto = require("crypto");

(async () => {
  const browser = await puppeteer.launch();
  for (let i = 0; i < 3; i++) {
    const context = await browser.createBrowserContext({
      proxyServer: "http://gw.nodelighthouse.com:10000",
    });
    const page = await context.newPage();
    await page.authenticate({
      username: "<USERNAME>-type-residential-country-us-lifetime-10-session-" + crypto.randomBytes(4).toString("hex"),
      password: "<PASSWORD>",
    });
    await page.goto("https://api.ipify.org");
    console.log("context", i, await page.evaluate(() => document.body.innerText));
    await context.close();
  }
  await browser.close();
})();

Target a location

Location goes in the username, so the launch arguments stay the same. For example, Los Angeles on the rotating port:

// --proxy-server=http://gw.nodelighthouse.com:9000
await page.authenticate({
  username: "<USERNAME>-type-residential-country-us-state-california-city-losangeles",
  password: "<PASSWORD>",
});

Questions

Why not put the credentials in --proxy-server?
Chrome ignores credentials in the --proxy-server argument. page.authenticate() answers the proxy's authentication challenge instead.
Can I use SOCKS5 with Puppeteer?
Chrome does not support username and password authentication on SOCKS5 proxies, so use the HTTP ports 9000 and 10000. They carry HTTPS traffic as well.
How do I check which IP a page is using?
Open https://api.ipify.org in the same page or context, as in the examples. It returns the IP the target site sees.

Related guides: Playwright · Selenium

Try it on your own targets

A flat $1.65/GB on every plan, with state and city targeting included. Start with the $2 for 500 MB test pack, paid in crypto.

Residential proxies with Puppeteer: setup guide