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:
- Country: the country your accounts or targets belong to. Add a city only if you really need it, because a narrow target has fewer IPs.
- IP rotation: Sticky, 10 or 30 minutes. A browser loads dozens of files per page and keeps cookies, so all of that should come from one IP. Rotating lines give each connection a different IP, which breaks logins and looks odd to sites.
- Protocol: HTTP(S). Chrome does not support SOCKS5 with a username and password, so authenticated SOCKS5 lines fail in Puppeteer.
- Server region: Global (nearest) unless your tool runs far from the target country. This picks the gateway you connect to, not the exit country.
- Format:
protocol://user:pass@host:port. The code below splits it into the parts Chrome needs. - How many: one line per browser context you run at the same time.
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
- WebRTC: Chrome can reveal your real IP through WebRTC, outside the proxy. Add
--force-webrtc-ip-handling-policy=disable_non_proxied_udpto the launch args. - Timezone: a US IP with your local timezone is a mismatch. Set it per page, for example
await page.emulateTimezone('America/New_York'). - Language: set an
Accept-Languageheader that fits the country withpage.setExtraHTTPHeaders().
Troubleshooting
- 407 or "proxy authentication failed": the password field is missing the options part, a character was lost when copying, or the line has a space at the end. Paste the generated line again.
- Connection refused or timeout: wrong port, or the protocol in the tool does not match the line (a SOCKS5 line set as HTTP or the other way round). Generate the line again with the protocol the tool uses.
- Wrong country: geolocation databases disagree, especially at city level. Check the exit IP on ipinfo.io before you trust a checker built into a tool.
- "No IP available" / 502: the city or carrier is too narrow. Widen to country level.
- Works in curl, fails in the tool: it is almost always the format or protocol. See the guide on proxy formats.
net::ERR_TUNNEL_CONNECTION_FAILED: the proxy refused the CONNECT, usually a wrong login orpage.authenticate()missing on that page.net::ERR_NO_SUPPORTED_PROXIES: you passed asocks5://line with a login. Use an HTTP line.- Login in the
--proxy-serverURL: Chrome ignores it. Pass onlyproxy.origin.
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.