Proxy plans now up to 15% cheaper
View pricing

Playwright

Configure a proxy in Playwright with username/password auth. Set the proxy per-context or browser-wide with code examples.

Integrations5 min read

This page covers Playwright proxy setup across Chromium, Firefox, and WebKit, with native username/password authentication and no auth extension required. You can set the proxy once at browser launch, or per browser.context to run several ColdProxy exit IPs side by side in one process. It includes Python and Node examples, rotating and sticky setups, and the one real limitation to know about (SOCKS5 auth). New to proxy auth? See IP whitelisting vs username/password.

Note

ColdProxy auto-detects HTTP, HTTPS, and SOCKS5 on every port in 30000-34999. For Playwright, use the http:// scheme with user:pass. SOCKS5 with a username and password is not supported by the browser engine (see the warning below), so route SOCKS5 through IP authentication instead.

Your ColdProxy connection details

Code
Server:   http://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 check the proxy with the proxy checker and my IP.

Use a proxy browser-wide with authentication (Python and Node)

Playwright's proxy option takes { server, username, password }. Set it on launch to apply it to every context the browser opens.

Python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(proxy={
        "server": "http://gw-2312.coldproxy.com:30000",
        "username": "USERNAME",
        "password": "PASSWORD",
    })
    page = browser.new_page()
    page.goto("https://api.vipv6proxy.com/api/checker/my-ip")
    print(page.content())
    browser.close()
JavaScript
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({
    proxy: {
      server: 'http://gw-2312.coldproxy.com:30000',
      username: 'USERNAME',
      password: 'PASSWORD',
    },
  });
  const page = await browser.newPage();
  await page.goto('https://api.vipv6proxy.com/api/checker/my-ip');
  console.log(await page.content());
  await browser.close();
})();
Tip

The same proxy object works for p.firefox.launch(...) and p.webkit.launch(...). Per-context proxies (next section) work with a plain launch() on current Playwright; only older Playwright/Chromium versions required a placeholder proxy at launch first.

Per-context proxies for rotation

To run multiple ColdProxy exits at once (for example a rotating IP per browser context), set the proxy on new_context / newContext. This is the cleanest way to parallelize across sessions.

Python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()

    ctx_a = browser.new_context(proxy={
        "server": "http://gw-2312.coldproxy.com:30000",
        "username": "USERNAME",        # rotating: new IP per request
        "password": "PASSWORD",
    })
    # The exit is controlled by the username tags, not the port: this context
    # holds one sticky US IP while ctx_a keeps rotating.
    ctx_b = browser.new_context(proxy={
        "server": "http://gw-2312.coldproxy.com:30000",
        "username": "user-country-us-session-481516-time-10m",
        "password": "PASSWORD",
    })

    for ctx in (ctx_a, ctx_b):
        page = ctx.new_page()
        page.goto("https://api.vipv6proxy.com/api/checker/my-ip")
        print(page.text_content("body"))
    browser.close()
JavaScript
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();

  const ctxA = await browser.newContext({
    proxy: { server: 'http://gw-2312.coldproxy.com:30000',
             username: 'USERNAME', password: 'PASSWORD' },
  });
  // Username tags (not the port) control the exit: ctxB holds a sticky US IP.
  const ctxB = await browser.newContext({
    proxy: { server: 'http://gw-2312.coldproxy.com:30000',
             username: 'user-country-us-session-481516-time-10m', password: 'PASSWORD' },
  });

  for (const ctx of [ctxA, ctxB]) {
    const page = await ctx.newPage();
    await page.goto('https://api.vipv6proxy.com/api/checker/my-ip');
    console.log(await page.textContent('body'));
  }
  await browser.close();
})();

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). Each context can carry a different tagged username, which is how you assign each context its own country or its own sticky IP. Rotation is the default; a sticky IP needs both a session id and a duration together. See rotating and sticky proxies and geo-targeting with proxies.

Python
# Rotating, United States — new IP per request
ctx = browser.new_context(proxy={
    "server": "http://gw-2312.coldproxy.com:30000",
    "username": "user-country-us",
    "password": "PASSWORD",
})

# Sticky 10 minutes, United States — same IP while the session holds
ctx = browser.new_context(proxy={
    "server": "http://gw-2312.coldproxy.com:30000",
    "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 before hardcoding them. 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 also supports IP authentication; whitelist up to 50 IPs in the client area or via the plan API and drop username/password entirely:

Python
browser = p.chromium.launch(proxy={
    "server": "http://gw-2312.coldproxy.com:30000",
})
Warning

SOCKS5 with a username and password does not work in Playwright: SOCKS proxy authentication is not supported by the browser engine. If you need SOCKS5 (socks5://gw-2312.coldproxy.com:30000), authenticate with IP whitelisting, not user:pass. For credentialed proxies, use the http:// scheme. Background: 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 switch to user:pass with username tags.

Verify and troubleshoot

  • Load https://api.vipv6proxy.com/api/checker/my-ip in the page, or run the proxy checker, to confirm the exit IP and location.
  • ERR_PROXY_CONNECTION_FAILED immediately 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 page that loads from your real IP means the proxy was not applied; re-check the proxy config (and remember SOCKS5 auth is unsupported), then move to http:// or IP whitelisting.
  • 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). For other failures, see Common errors & fixes.

Ready to provision? Compare options 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