coreproxies.com
PuppeteerIntegration guide

Puppeteer proxy setup

Puppeteer sets a proxy in two steps: a Chrome launch flag for the address and a call to page.authenticate() for the login. This guide covers both, then shows sticky sessions per browser context and the errors to expect.

Last updated:

Connection fields

The four values from your dashboard are split between a launch argument and a page method.

A proxy line reads HOST:PORT:USERNAME:PASSWORD. Chrome accepts only the first half on the command line, so Puppeteer handles the two halves separately:

  • Host and port go into the launch argument --proxy-server=http://HOST:PORT.
  • Username and password go to page.authenticate({ username, password }), called before the first navigation of that page.

Writing the login inside the flag, as in --proxy-server=http://USERNAME:PASSWORD@HOST:PORT, does not work: Chrome ignores credentials there. Call page.authenticate() on every page you open, because the setting belongs to the page and is not inherited by a new one.

ProductHost and portProtocolsAuthentication
Residential and Unlimited Residentialshown in your dashboardHTTP, HTTPS and SOCKS5 on the same portusername:password
Rotating Mobileshown in your dashboardHTTP(S) and SOCKS5 on the same portusername:password
Mobile Proxy (Reset Link)shown in your dashboardHTTP(S) and SOCKS5 on the same portusername:password
Datacenter, ISP and IPv6shown with your order in the dashboardHTTP(S) and SOCKS5 on separate portsusername:password

HOST, PORT, USERNAME and PASSWORD in the examples are placeholders. Your dashboard shows the host, port, username and password for each plan: copy them from the Proxy generator.

HTTP(S) or SOCKS5

Puppeteer drives Chrome, so Chrome decides what each protocol can do.

ProtocolResidential and mobile plansDatacenter, ISP and IPv6In Puppeteer
HTTP(S)host and port from your dashboardHTTP(S) port shown with your orderFlag plus page.authenticate(). Use this by default.
SOCKS5same host and portSOCKS5 port shown with your orderFlag only; Chrome cannot log in to a SOCKS5 proxy, so it cannot be used with a username and password.

The HTTP(S) port is the right choice whenever you authenticate with a username and password. HTTPS pages still work through it, because Chrome asks the proxy for a CONNECT tunnel and encrypts inside it.

Authentication example

Launch Chrome behind the proxy, log in and print the exit IP.

import puppeteer from "puppeteer";

// Copy HOST, PORT, USERNAME and PASSWORD from your dashboard (Proxy generator).
const browser = await puppeteer.launch({
  args: ["--proxy-server=http://HOST:PORT"],
});
const page = await browser.newPage();
await page.authenticate({ username: "USERNAME", password: "PASSWORD" });

await page.goto("https://api.ipify.org?format=json");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();

Replace HOST, PORT, USERNAME and PASSWORD with the values from your dashboard; copy them from the Proxy generator. The script uses ES module syntax, so save it as .mjs or set "type": "module" in package.json. It is the same for every plan; only the four values change.

page.authenticate() answers the proxy's 407 challenge behind the scenes. It works in headless and headed mode, and no login dialog appears.

Rotation and sticky sessions

Rotation is controlled by the username you pass to page.authenticate().

On a Residential plan the plain USERNAME rotates: each new connection can leave from a new IP, so the separate requests that make up one page can leave from different addresses. Use it for independent page fetches. For a flow that must look like one visitor from start to finish, switch to a sticky username so the whole visit keeps one address.

To run several sticky sessions side by side, create one browser context per session. browser.createBrowserContext() accepts a proxyServer, and each page in that context gets its own credentials:

import puppeteer from "puppeteer";

// Residential plan: copy HOST, PORT, USERNAME and PASSWORD from your dashboard (Proxy generator).
const SERVER = "http://HOST:PORT";
const PASSWORD = "PASSWORD";

// One sticky session per browser context: each context keeps its own IP for 600 seconds.
const sessionIds = ["482913", "615027"];

const browser = await puppeteer.launch();
for (const id of sessionIds) {
  const context = await browser.createBrowserContext({ proxyServer: SERVER });
  const page = await context.newPage();
  await page.authenticate({
    username: `USERNAME-session-${id}-ttl-600`,
    password: PASSWORD,
  });
  await page.goto("https://api.ipify.org?format=json");
  console.log(id, await page.evaluate(() => document.body.innerText));
  await context.close();
}
await browser.close();

createBrowserContext() is the name in Puppeteer 22 and later; earlier releases call it createIncognitoBrowserContext(). Contexts also keep cookies apart, so a session number and a context together make one separate identity. When you want a new IP for an identity, close its context and open another with a different session number.

ProductNew IPSame IPLocation
Residential and Unlimited ResidentialUSERNAME (every new connection)USERNAME-session-482913-ttl-600USERNAME-country-de
Rotating MobileUSERNAME (every new connection)USERNAME-session-482913-ttl-600chosen in your dashboard
Mobile Proxy (Reset Link)Change IP button or reset linkUSERNAME keeps one IP for up to 24 hourschosen in your dashboard
Datacenter, ISP and IPv6set in the Proxy generatorset in the Proxy generatorset in the Proxy generator

On Residential and Unlimited Residential the username on its own rotates, so every new connection gets a new IP. For a sticky session add -session- with a number and -ttl- with the time in seconds. Sticky sessions last up to 24 hours; the dashboard offers 1 minute, 10 minutes, 30 minutes, 1 hour, 6 hours and 24 hours, or a custom time. Use a different session number for each account or task; a new number gives you a new IP. On Datacenter, ISP and IPv6, the Proxy generator of your order builds the username for you: copy the generated lines from there. Details are in the rotating proxies guide.

For IPs from one country on Residential or Unlimited Residential, add -country- and a two-letter country code to the username, for example USERNAME-country-de. State and city are chosen in the Proxy generator, which adds them to the username for you. Location and session combine as USERNAME-country-de-session-482913-ttl-600:

import puppeteer from "puppeteer";

// Residential and Unlimited Residential: copy HOST, PORT, USERNAME and PASSWORD
// from your dashboard (Proxy generator).
const browser = await puppeteer.launch({
  args: ["--proxy-server=http://HOST:PORT"],
});
const page = await browser.newPage();
await page.authenticate({
  // IPs from Germany, one IP held for 600 seconds.
  username: "USERNAME-country-de-session-482913-ttl-600",
  password: "PASSWORD",
});
await page.goto("https://api.ipify.org?format=json");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();

On Rotating Mobile you choose All countries or a single country in your dashboard, and the carrier inside that country is picked automatically. The username carries only the session: without one, every new connection gets a new carrier IP.

On Rotating Mobile the session ID must be numbers only (digits 0–9); an ID with letters is ignored and the IP keeps rotating. The number is only an example: pick your own, such as a random 6-digit number, and use a different one for each account or task. The ttl value is how long you want to keep the IP, in seconds. Mobile networks can still change an IP on their own, so plan for an occasional change.

Mobile Proxy (Reset Link) keeps one carrier IP for up to 24 hours. Change it with the Change IP button or your reset link, once every 30 seconds; changing the location in your dashboard also gives you a new IP.

Test the connection

Check the exit IP first, then move on to the real target.

Each script on this page opens https://api.ipify.org?format=json and prints the body. The address shown should not be your own. For a visual check, launch with headless: false and open the My IP tool in the automated window; open it in your everyday browser as well and compare the two addresses.

import puppeteer from "puppeteer";

// Copy HOST, PORT, USERNAME and PASSWORD from your dashboard (Proxy generator).
const browser = await puppeteer.launch({
  args: ["--proxy-server=http://HOST:PORT"],
});
const page = await browser.newPage();
await page.authenticate({ username: "USERNAME", password: "PASSWORD" });

try {
  const response = await page.goto("https://api.ipify.org?format=json", {
    waitUntil: "domcontentloaded",
    timeout: 30000,
  });
  console.log("status:", response.status());
  console.log("exit IP:", await page.evaluate(() => document.body.innerText));
} catch (error) {
  // Proxy problems surface here as net::ERR_... messages or as a navigation timeout.
  console.error("request failed:", error.message);
} finally {
  await browser.close();
}

Troubleshooting

What the common failures look like from inside Puppeteer.

407 Proxy Authentication Required

Either page.authenticate() was not called before page.goto(), or the proxy rejected the values. Check the username and its suffix, the password, and that both belong to the plan whose host is in the flag. Remember to authenticate every new page, including pages opened in a new context.

Timeouts and net::ERR_ errors

net::ERR_PROXY_CONNECTION_FAILED means Chrome could not connect to the proxy: check the host, the port and outbound firewall rules for the proxy port. net::ERR_TUNNEL_CONNECTION_FAILED means the proxy answered but refused the tunnel; review the login and the target port. If page.goto() runs into its 30-second default on a heavy page while the IP check works, pass a larger timeout or use waitUntil: "domcontentloaded".

Target ports by plan

On Residential and Unlimited Residential plans, residential IPs connect to websites on ports 80 and 443 only: a URL that names another port, such as :8443, fails even when the proxy login is correct.

All target ports are open on Rotating Mobile and Mobile Proxy (Reset Link) plans.

Puppeteer proxy setup: frequently asked questions

Why does Puppeteer ignore the username and password in --proxy-server?

Chrome does not read credentials from that flag. Put only the scheme, host and port in the flag and pass the username and password to page.authenticate().

Do I have to call page.authenticate() for every page?

Yes. The credentials are stored per page, so call it on each new page before its first navigation.

Can Puppeteer use a SOCKS5 proxy with authentication?

No. Chrome cannot log in to a SOCKS5 proxy. Use the HTTP(S) port with page.authenticate(); on Residential and mobile plans HTTP(S) and SOCKS5 share one host and port.

How do I use a different proxy session for each Puppeteer tab?

Create a browser context for each session with browser.createBrowserContext({ proxyServer }) and authenticate its pages with a username that carries a different session number.

Does this work with puppeteer-core?

Yes. The launch flag and page.authenticate() are the same; puppeteer-core only differs in that you point it at an installed browser.

Get started

Run Puppeteer through Core Proxies

Create an account, choose your proxy type and plan, and copy the host, port, username and password from your dashboard. Activation is automatic after payment.

  • Rotating and sticky sessions
  • HTTP(S) and SOCKS5
  • 24/7 support by email
Plans to start withDatacenter and ISP
Datacenterfrom €15 / month · 250 GB · 100 IPsSee pricing
ISPfrom €18.23 / 250 GB + €0.23 / IPSee pricing

Prices exclude VAT