Proxy plans now up to 15% cheaper
View pricing

Puppeteer

Set a proxy in Puppeteer, including authenticated proxies. Pass args to launch and handle credentials with copy-paste code.

Integrations4 min read

This page covers Puppeteer proxy setup, including authenticated proxies. Puppeteer launches Chrome/Chromium, so a ColdProxy gateway connects through the --proxy-server launch argument, and Puppeteer's page.authenticate() supplies the username and password. The key thing to know: page.authenticate() answers HTTP/HTTPS proxy auth only; SOCKS5 username/password is a browser-level gap, so use IP authentication (or an upstream helper) for SOCKS5. Below are rotating and sticky setups, plus the puppeteer-extra variant. For background, see IP whitelisting vs username/password.

Note

ColdProxy auto-detects HTTP, HTTPS, and SOCKS5 on every port in 30000-34999. For Puppeteer prefer HTTP(S) with page.authenticate(); for SOCKS5, authenticate by IP whitelist.

Your ColdProxy connection details

Code
Proxy server: gw-2312.coldproxy.com:30000
Username:     USERNAME     (may carry geo/session tags — see below)
Password:     PASSWORD

2312 is your service/package ID from the client area; 30000 is any port in your plan's 30000-34999 allocation. Residential IPv4 (GB Based) and Residential IPv6 activate instantly after payment clears; Residential IPv4 (Unmetered) and Datacenter IPv6 start automatic setup after payment clears. Allow up to 10 minutes for those two plans and connect as soon as setup completes. See Activation and setup times, then verify with the proxy checker and my IP.

Set the proxy and authenticate with page.authenticate()

Pass the gateway on --proxy-server, then call page.authenticate() with your credentials before the first navigation. Chrome will not accept user:pass@host inside --proxy-server, which is exactly why page.authenticate() exists.

JavaScript
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    args: ['--proxy-server=gw-2312.coldproxy.com:30000'],
  });
  const page = await browser.newPage();

  await page.authenticate({ username: 'USERNAME', password: 'PASSWORD' });

  await page.goto('https://api.vipv6proxy.com/api/checker/my-ip', { waitUntil: 'domcontentloaded' });
  console.log(await page.evaluate(() => document.body.innerText));
  await browser.close();
})();
Warning

page.authenticate() is per-page: call it on every new page (or new context's page) before you navigate. It covers HTTP/HTTPS proxy auth. It does not authenticate SOCKS5 proxies; see the SOCKS5 section.

Rotating across pages and contexts

The proxy is fixed at launch, so to use several ColdProxy exits at once, launch one browser per configuration or use isolated browser contexts and authenticate each page. The exit behavior is controlled by the tagged username you pass to page.authenticate(), not by the port.

JavaScript
const puppeteer = require('puppeteer');

async function withProxy(username) {
  const browser = await puppeteer.launch({
    args: ['--proxy-server=gw-2312.coldproxy.com:30000'],
  });
  const page = await browser.newPage();
  await page.authenticate({ username, password: 'PASSWORD' });
  await page.goto('https://api.vipv6proxy.com/api/checker/my-ip');
  const body = await page.evaluate(() => document.body.innerText); // JSON: {ip, country, ...}
  await browser.close();
  return body;
}

(async () => {
  console.log(await withProxy('USERNAME')); // rotating
  console.log(await withProxy('user-country-us-session-481516-time-10m')); // sticky US
})();

Geo-targeting and sticky sessions through the username

ColdProxy encodes geo and session controls as tags inside the username, grammar user-key-value-key-value... (full reference: Username tag scheme). Rotation is the default; a sticky IP needs both a session id and a duration together. The tagged username goes straight into page.authenticate(). See rotating and sticky proxies and geo-targeting with proxies.

JavaScript
// Rotating, United States — new IP per request
await page.authenticate({ username: 'user-country-us', password: 'PASSWORD' });

// Sticky 10 minutes, United States — same IP while the session holds
await page.authenticate({
  username: 'user-country-us-session-481516-time-10m',
  password: 'PASSWORD',
});
Warning

The exact tag prefixes (e.g. country, state, city, session, time, identifier) are set per product by ColdProxy; confirm the prefixes for your plan in your client area. Sticky limits differ by product: Residential IPv4 supports 5s-24h; Residential IPv6 and Datacenter IPv6 support 5s-FOREVER.

IP whitelisting (no credentials — and the SOCKS5 path)

ColdProxy supports IP authentication: whitelist up to 50 IPs in the client area or the plan API, and skip page.authenticate() entirely.

JavaScript
const browser = await puppeteer.launch({
  args: ['--proxy-server=gw-2312.coldproxy.com:30000'],
});
// No page.authenticate() needed — this machine's IP is whitelisted

For SOCKS5, IP whitelisting is the way to authenticate, because Chrome cannot do SOCKS5 user:pass:

JavaScript
const browser = await puppeteer.launch({
  args: ['--proxy-server=socks5://gw-2312.coldproxy.com:30000'],
});
Tip

If you need SOCKS5 with credentials (not IP-auth), front the ColdProxy gateway with a local forwarding proxy such as proxy-chain and pass its local http://127.0.0.1:PORT URL to --proxy-server (check your proxy-chain version's documentation for SOCKS upstream support). Most teams find IP whitelisting simpler. See SOCKS5 vs HTTPS proxies.

Note

With IP-auth and no SuperPorts, the gateway defaults to Worldwide geo. Bind country/state/city to a port range with SuperPorts to geo-target as an IP-auth user, or use user:pass with username tags.

puppeteer-extra and stealth

If you already run puppeteer-extra with the stealth plugin in a legitimate, authorized workflow, proxy setup is identical; the launch arg and page.authenticate() behave the same:

JavaScript
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());

const browser = await puppeteer.launch({
  args: ['--proxy-server=gw-2312.coldproxy.com:30000'],
});
const page = await browser.newPage();
await page.authenticate({ username: 'USERNAME', password: 'PASSWORD' });

Verify and troubleshoot

  • Read document.body.innerText after loading https://api.vipv6proxy.com/api/checker/my-ip, or run the proxy checker, to confirm the exit IP and location.
  • If pages load but show your real IP, page.authenticate() likely ran after goto; move it before the first navigation.
  • net::ERR_PROXY_CONNECTION_FAILED right after ordering can have several causes. Check your settings and service status. If you bought Residential IPv4 (Unmetered) or Datacenter IPv6, automatic setup may still be running for up to 10 minutes after payment clears; see Activation and setup times.
  • A SOCKS5 launch that ignores the proxy is the Chrome SOCKS5-auth gap; switch to IP whitelisting or the proxy-chain upstream.
  • For IPv6 plans, check the target with the IPv6 checker before buying: it should publish an AAAA record or be served by a supported CDN (see IPv6 reachability). Confirmed IPv6-ready platforms include Google, YouTube, Facebook, Instagram, Bing, and LinkedIn.

Ready to provision? Compare plans on pricing or browse the proxy products.

Need a tailored proxy plan for a large project?

Need a different speed or traffic allowance? Contact us through the channels on our website so we can assess whether a custom plan is possible.

Contact Our Sales TeamTelegram & ticket support · English and Arabic