Home / Setup guides

Puppeteer proxy setup with username and password

Updated November 15, 2026 · 4 min read

Use residential proxies with a login in Puppeteer: --proxy-server plus page.authenticate, one sticky IP per browser context, blocked images, no WebRTC leaks.

Chrome cannot read a username and password from --proxy-server. That one fact causes most "Puppeteer proxy not working" questions. The fix is simple: give Chrome the host and port, and send the login with page.authenticate(). Below is a working setup, then a version with a different IP per browser context.

Step 1: Generate your proxy lines

Sign in to the Proxare dashboard, open the product you bought and switch to Generate. For this tool, use:

Each line carries your login plus the targeting and session options. On a Proxare Premium plan with a sticky US session it looks like this (yours has your own login, and the host and port depend on the product):

premium.proxare.com:6011:px_alice:k7Qm2x-country-us_session-ab12cd34_lifetime-30m

The part after your password (-country-us_session-…) is how the gateway knows which country and which session you want. Always copy the whole generated line; if you type your plain dashboard password into a tool, you get a random country and a new IP on every connection.

Step 2: One browser, one proxy

import puppeteer from 'puppeteer';

// One line from the Proxare dashboard, URL format, e.g. from an environment variable
const proxy = new URL(process.env.PROXY);

const browser = await puppeteer.launch({
  args: ['--proxy-server=' + proxy.origin],   // host and port only
});
const page = await browser.newPage();
await page.authenticate({
  username: decodeURIComponent(proxy.username),
  password: decodeURIComponent(proxy.password),
});

await page.goto('https://api.ipify.org');
console.log('Exit IP:', await page.evaluate(() => document.body.innerText));
await browser.close();

Run it with the line in the environment:

PROXY='http://px_alice:k7Qm2x-country-us_session-ab12cd34_lifetime-30m@premium.proxare.com:6011' node proxy-test.mjs

page.authenticate() applies to one page. Call it on every new page, including pages opened by popups.

Step 3: A different IP per browser context

Launching a browser per proxy is heavy. Puppeteer can set a proxy per browser context instead, and each context has its own cookies and storage. Generate several sticky lines and give each context one:

import puppeteer from 'puppeteer';
import { readFileSync } from 'node:fs';

const lines = readFileSync('proxies.txt', 'utf8').split('\n').filter(Boolean).map((l) => new URL(l.trim()));
const browser = await puppeteer.launch();

async function openSession(proxy) {
  const context = await browser.createBrowserContext({ proxyServer: proxy.origin });
  const page = await context.newPage();
  await page.authenticate({
    username: decodeURIComponent(proxy.username),
    password: decodeURIComponent(proxy.password),
  });
  return { context, page };
}

const sessions = await Promise.all(lines.slice(0, 3).map(openSession));
for (const { page } of sessions) {
  await page.goto('https://api.ipify.org');
  console.log(await page.evaluate(() => document.body.innerText));
}
await browser.close();

Each line has its own session ID, so each context prints a different IP. On Puppeteer versions before 22, the method is called createIncognitoBrowserContext and takes the same option.

Step 4: Cut data use by blocking images

A full page load is often 2 MB or more, mostly images, fonts and video. If you only need the HTML and data, block them:

await page.setRequestInterception(true);
page.on('request', (req) => {
  if (['image', 'media', 'font'].includes(req.resourceType())) req.abort();
  else req.continue();
});

This often cuts traffic by half or more. See how many GB you need for the numbers.

Step 5: Do not leak your real IP or location

Troubleshooting

Still stuck? Run the line through curl first (see how to test a proxy with curl): if curl works, the problem is the tool's settings, and support can tell you which. Message us on Telegram with the error text, never with your password.

Setup guides for other tools

Menu names can change between Puppeteer versions; if a label differs, look for the proxy section of the same screen. Proxare is not affiliated with Puppeteer. All product names are trademarks of their owners.