PRIVATEBYTE
ServersProxiesAgentsStatusNetworkAboutFree Proxies
Sign inDeploy

← Docs / Proxies

Datacenter proxies with Puppeteer

Chrome takes the proxy address as a launch flag, and Puppeteer supplies the credentials. This page uses the datacenter tier: a US datacenter IP that changes for every new connection.

What you need

  • Your proxy API key, from the Proxies page in the portal.
  • npm install puppeteer (or puppeteer-core with your own Chrome).
export PB_PROXY_KEY="YOUR_KEY"

Launch a browser through the proxy

import puppeteer from "puppeteer";

const browser = await puppeteer.launch({
  args: ["--proxy-server=http://proxy.privatebyte.com:3128"],
});

const page = await browser.newPage();
await page.authenticate({
  username: process.env.PB_PROXY_KEY,
  password: "datacenter",
});

await page.goto("https://api.ipify.org");
console.log(await page.evaluate(() => document.body.innerText)); // a US datacenter address

await browser.close();

Call page.authenticate() before the first goto(). The flag sets where the proxy is, and authenticate() answers its login prompt.

Get a new IP

One browser keeps its connections open, so every page in it leaves from the same address. Create a new browser context to get a new one:

for (let i = 0; i < 3; i++) {
  const context = await browser.createBrowserContext();
  const page = await context.newPage();
  await page.authenticate({
    username: process.env.PB_PROXY_KEY,
    password: "datacenter",
  });
  await page.goto("https://api.ipify.org");
  console.log(await page.evaluate(() => document.body.innerText));
  await context.close();
}

Authenticate each new page, because a new context starts clean. In older Puppeteer versions the method is createIncognitoBrowserContext().

Know the limits

  • The datacenter tier is US only and has no sessions. A site that checks the reputation of an address may block it. If you see 403 or a challenge page, use a residential tier such as standard.
  • Chrome remembers proxy logins for an address until it restarts. Keep the password the same within one browser run.

Errors

What you see What it means
ERR_TUNNEL_CONNECTION_FAILED with a 407 The API key is wrong or missing.
ERR_TUNNEL_CONNECTION_FAILED with a 400 The password asked for something this tier does not do: a country other than US, a session or a TTL.
A page returns 403 The site is refusing datacenter addresses.
A 400 that names an unknown tier The tier word is a close misspelling of a real tier, such as datacentre. Fix the spelling. A password that is not close to any tier, such as x, uses your account's default tier.

Related

  • Datacenter proxies with Playwright
  • Proxy connection format and tiers
  • Datacenter proxies

Try your next connection.

Free proxy credit for eligible new proxy users. No card required. Review the amount and conditions before claiming.

Get free proxy credit →

Explore proxy tiers and paid credit

Related

Proxies: your first requestFind your credentials, copy a cURL or Python example, and check the response.Proxy connection format and tiersWhat goes in the username and password, and what each tier is for.Using SOCKS5Port 1080, the same credentials, and the two things SOCKS5 cannot do.

Still stuck? Open a ticket — tell us what was missing and the article gets fixed.

PRIVATEBYTE

Infrastructure for independent minds.

Service status

Products

Virtual serversProxiesGet free proxy creditAgentsMigration

Resources

Looking glassSecurityBlogNews

Free tools

What is my IPProxy checkerPort checkerDomain checkerDNS lookupPassword generatorVPS price calculator

Company

AboutContactX / TwitterTelegram
© 2026 PrivateByte Ltd
TermsPrivacyAcceptable useRefundsAbuse & legalSLA

Registered in England & Wales · Company no. 15834803 · 128 City Road, London EC1V 2NX