Skip to content

Playwright Proxy: One Authenticated IP per Browser Context

Give every Playwright worker its own exit IP — a fixed datacenter IP for tests, a household IP when the site blocks servers.

Why Playwright needs a proxy

Playwright drives a real browser, but every page it loads still leaves from your machine's IP. Run many contexts from one server and the site sees one address doing the work of many visitors. The usual reply is HTTP 429 Too Many Requests — the server telling you to slow down — or a block.

Proxy support is built in. You can set one proxy for the whole browser or a separate proxy for each browser context, so parallel workers leave through different IPs. Playwright documents the username and password fields for HTTP proxies.

Use HTTP for password-protected proxies in Chromium. Chrome supports no authentication method for SOCKS5 and won't use credentials written into proxy settings, so a socks5:// server with a password fails in Chromium even though Playwright accepts socks5:// addresses.

Recommended Playwright setup

Scroll horizontally with the arrow keys to read all content.

Recommended Playwright setup
ItemChooseWhy
ProductStatic datacenter proxyFastest and cheapest per IP, fixed for the whole term — right for test runs, CI and sites that accept server IPs
If the site blocks serversRotating residential, Budget lineReal household IPs from US$1.50/GB; you pay for traffic, not per IP
How many IPsOne per parallel worker (browser context)Workers stop sharing one address and one rate limit
CountryWhere your users are: US, CA, GB, DE, NL, JP, KR or SG for datacenterSites that adapt to location show each country its own version
ProtocolHTTPChromium can't send a SOCKS5 password; HTTP authenticates in every Playwright browser
IP changesDatacenter: never during the termRenew in My assets; a datacenter IP keeps its address

The button below opens Static Datacenter Proxies with the AI and automation use case. Choose Region, Term, Protocol and Quantity (up to 100 IPs at a time) before you pay.

Which Proxy302 proxy to buy

Scroll horizontally with the arrow keys to read all content.

Which Proxy302 proxy to buy
ItemStatic ISPRotating residentialDatacenter
What you getA fixed home-broadband IP that stays the same for the whole termReal household IPs: rotating exits, or a sticky session in a chosen country or major cityFast fixed server IPs, HTTP and SOCKS5
PricePer IP and term — live price at checkoutBudget US$1.50/GB (US$1.35/GB at 100 GB); Premium US$5.00/GBPer IP and term — the cheapest per IP
Best for PlaywrightLogged-in flows that must keep one IP for weeksScraping sites that block server IPsCI, end-to-end tests and fast batch jobs

Prices in US dollars. Top up your wallet once and pay any line from it. Nothing renews unless you switch auto-renew on for an IP in My assets — or renew by hand there; renewing normally keeps the same IP.

Set up Playwright proxies in 5 steps

  1. Choose the region and term

    The button below opens Static Datacenter Proxies (Per IP and term) with the AI and automation use case. Under Connection settings pick the Region, choose a Term and set Protocol to HTTP. Set Quantity to the number of IPs you need (one for each parallel worker, up to 100 at a time). Then click Review cost and generate.

  2. Copy each IP

    In My assets, Copy gives a ready line in host:port:user:password form. Put host and port in PROXY_HOST and PROXY_PORT, user and password in PROXY_USER and PROXY_PASS — environment variables keep the password out of your code.

  3. Add the proxy to Playwright

    Use the code below. A proxy on newContext() gives each worker its own IP; a proxy on launch() applies one IP to the whole browser. The server must be http://host:port.

  4. Check the exit IP

    The script opens api.ipify.org and prints the IP the site sees.

    Expected result The printed IP is the proxy's address, not your server's.

  5. If a site blocks datacenter IPs

    Open Rotating Residential Proxies instead: set Line to Budget, use Add traffic to buy a package (from 1 GB), then set Exit mode to Global rotation for new exits on new connections, or to Choose region / sticky IP to stay in one country or major city. Rotating residential connects through proxy.proxy302.com:2222 for HTTP.

Playwright proxy with username and password (Node.js)

Scroll horizontally with the arrow keys to read all content.

// npm i playwright   then   npx playwright install chromium
import { chromium } from 'playwright'

// From Proxy302 → My assets → Copy (host:port:user:password)
const { PROXY_HOST, PROXY_PORT, PROXY_USER, PROXY_PASS } = process.env

const browser = await chromium.launch()
// One proxy per browser context: each parallel worker gets its own exit IP
const context = await browser.newContext({
  proxy: {
    server: `http://${PROXY_HOST}:${PROXY_PORT}`, // HTTP: Chromium can't send a SOCKS5 password
    username: PROXY_USER,
    password: PROXY_PASS,
  },
})
const page = await context.newPage()
await page.goto('https://api.ipify.org?format=json')
console.log(await page.textContent('body')) // {"ip":"..."}: the proxy's exit IP, not your server's
await browser.close()

Checked on 2026-10-18 with Playwright 1.63.0 and Chromium 153 against a local password-protected proxy: the right credentials loaded the page, a wrong password loaded nothing. Swap the IP-check URL for your target.

The same in Python

Scroll horizontally with the arrow keys to read all content.

# pip install playwright   then   playwright install chromium
import os
from playwright.sync_api import sync_playwright

# From Proxy302 → My assets → Copy (host:port:user:password)
proxy = {
    "server": f"http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}",
    "username": os.environ["PROXY_USER"],
    "password": os.environ["PROXY_PASS"],
}

with sync_playwright() as p:
    browser = p.chromium.launch(proxy=proxy)  # or browser.new_context(proxy=proxy) per worker
    page = browser.new_page()
    page.goto("https://api.ipify.org?format=json")
    print(page.text_content("body"))  # the proxy's exit IP
    browser.close()

Playwright for Python takes the same proxy dictionary in launch() or new_context(). Syntax-checked; the Node.js version above was run end to end.

Playwright MCP through a proxy

Playwright MCP lets an AI client such as Claude Code, Cursor or Codex drive a browser. Give it --proxy-server and that browser sends its traffic through your proxy. The credentials go inside the URL, as http://USER:PASS@HOST:PORT; there is no separate username option. --proxy-bypass takes a comma-separated list of domains that should not go through the proxy.

Use the HTTP endpoint of your proxy (port 2222 on Proxy302). The README also shows socks5:// addresses, but Playwright does not support SOCKS5 with a username and password: the request for it was closed as not planned on 31 October 2026. For an AI agent that drives a browser through its own library, see the browser-use proxy guide.

proxy302-mcp is the official Proxy302 MCP server, open source on GitHub and maintained by the Proxy302 team. Proxy302 also runs it at https://proxy302.com/v1/mcp: clients that can send an Authorization header, such as Claude Code, Cursor and VS Code, connect with an API key and install nothing. Install commands are in the proxy MCP server guide.

Playwright MCP through a proxy: mcpServers

Scroll horizontally with the arrow keys to read all content.

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest",
        "--proxy-server",
        "http://USER:PASS@HOST:PORT",
        "--proxy-bypass",
        ".example.com"
      ]
    }
  }
}

Replace USER, PASS, HOST and PORT with the values from My assets. The mcpServers block goes into your MCP client's configuration file.

Proxy302 at a glance

Scroll horizontally with the arrow keys to read all content.

Proxy302 at a glance
ItemPriceProtocolsLocationsFits agent work like
Rotating residentialFrom US$1.50 per GB (Budget line); US$5 per GB (Premium line); lower per GB in larger packagesHTTP, SOCKS5195+ countries and regions; state and major-city targetingBrowsing and research agents, data collection
Static ISP, per IPUS$0.50 for 1 day, US$7.99 for 30 days, the same in every countryHTTP or SOCKS5, chosen per IP30 countries on the order form; stock changes dailyOne fixed IP for each account an agent signs in to
ISP for AI subscriptionsPer 30 days: Claude 15 PTC, GPT / Grok 10 PTC, Gemini 8 PTC; the first order in each tier is 50% offHTTP or SOCKS5Claude: US, UK, DE, JP. GPT / Grok: US, UK, FR, JP, KR. Gemini: US, UK, FR, JPCoding tools and agents signed in to ChatGPT, Claude, Gemini or Grok
Datacenter, per IPUS$0.25 for 1 day, US$3.99 for 30 daysHTTP or SOCKS5, chosen per IP8 countriesAPI calls and tool traffic where the IP type does not matter
proxy302-mcpFree, open source (MIT)MCP over stdio, started with npxUses the products aboveLets Claude Code, Codex, Cursor and other MCP clients get a proxy and fetch pages through it

Prices are in PTC, paid from the wallet; 1 PTC = US$1. There is no free trial: the smallest purchase is 1 GB of rotating residential traffic or one IP for one day. Checked on 4 November 2026.

Quick fixes

407 Proxy Authentication Required

Check Do the username and password match the line in My assets? In Chromium, does the server start with http:// rather than socks5://?

Fix Copy the line again and paste host:port into server and the other two parts into username and password. These fields don't need URL encoding.

The page still shows your server's IP

Check Is the proxy set on the context that opened the page? Is the host listed in bypass?

Fix Set proxy on that newContext() (or on launch()) and remove the host from bypass.

Timeouts or net::ERR_PROXY_CONNECTION_FAILED

Check Is the IP active and unexpired in My assets? Does curl -x http://USER:PASS@HOST:PORT https://api.ipify.org work from the same machine?

Fix Renew or replace the IP. If curl fails too, the machine can't reach the proxy — check its firewall or outbound rules.

429s or a challenge page after a while

Check Are several contexts sharing one IP? How fast are pages loading?

Fix Give each context its own IP, slow down, or move that site to rotating residential.

Playwright proxy FAQ

How do I set a proxy in Playwright?

Use the proxy option with server, username and password — in launch() for the whole browser or in newContext() for one context. It works the same way in Node.js, Python, Java and .NET.

Does Playwright support SOCKS5 with a password?

Playwright accepts socks5:// servers, but Chromium can't authenticate to SOCKS5. For a password-protected Proxy302 line, use its HTTP endpoint.

How do I rotate IPs in Playwright?

Open a new context with a different proxy for each worker or session. With rotating residential and Exit mode set to Global rotation, new connections can leave through new exits; for a proxy held in one region, Rotate in My assets changes its IP.

Residential or datacenter for Playwright?

Datacenter when the site accepts server IPs — it's the fastest and cheapest per IP. Rotating residential when the site blocks or keeps challenging server IPs.

Can npx playwright install download browsers through a proxy?

Yes. Playwright documents installing behind a proxy: set HTTPS_PROXY to your proxy URL before running npx playwright install.

A CAPTCHA recognition service: CaptchaAI

CaptchaAI is a paid CAPTCHA recognition API for automation software. It is a separate third-party service and a Proxy302 partner; it does not supply proxies. Use it only where the site’s terms allow.

Reference links

13
  1. Playwright docs — Network: HTTP proxy

    Official documentation · Confirmed on:

  2. Playwright API — browserType.launch(): proxy option

    Official documentation · Confirmed on:

  3. Chromium — Proxy support in Chrome

    Official documentation · Confirmed on:

  4. Playwright docs — Install behind a firewall or a proxy

    Official documentation · Confirmed on:

  5. MDN — 429 Too Many Requests

    Official documentation · Confirmed on:

  6. Proxy302 pricing

    Product observation · Confirmed on:

    Rotating residential per-GB prices as published on the pricing page and used by the console (Budget US$1.50/GB, US$1.35/GB in the 100 GB package; Premium US$5.00/GB; 1 PTC = US$1). Static ISP and datacenter IPs are quoted live per IP and term.

  7. Proxy302 console — Static Datacenter Proxies

    Product observation · Confirmed on:

    Option names, billing modes and limits as shown in the live console on 2026-10-18: Line (Premium/Budget), Exit mode, Region, State, City, Protocol (HTTP/SOCKS5), Quantity (1–500), Term, My assets → Copy / Rotate / Renew / Copy for AI. Rotating residential connects through proxy.proxy302.com:2222 (HTTP) and :3333 (SOCKS5). Static datacenter IPs were sold in 8 countries on 2026-10-18 (read-only check of the production catalogue): US, CA, GB, DE, NL, JP, KR, SG. Since 24 October 2026 the console has an Auto-renew IP switch for static IPs (off for new purchases) on the purchase page and per IP in My assets.

  8. Local proxy fixture run

    Local example · Confirmed on:

    The code block was executed on 2026-10-18 against a local password-protected HTTP proxy that answers 407 without valid credentials; Playwright 1.63.0 with Chromium 153: the right credentials loaded the page through the proxy, a wrong password loaded nothing.

    A local check proves the configuration syntax and authentication path, not access to any specific website, country or platform.

  9. Playwright MCP README

    Official documentation · Confirmed on:

    Read on 4 November 2026: --proxy-server (for example http://user:password@myproxy:3128) and --proxy-bypass (comma-separated domains).

  10. Playwright issue 10567: Support socks5 proxy with authentication

    Official documentation · Confirmed on:

    Checked through the GitHub API on 4 November 2026: the request was closed as not planned on 31 October 2026. The Playwright option reference describes username and password for HTTP(S) proxies only.

  11. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, quantity limits, no free trial.

  12. Proxy302 ISP for AI subscriptions: public catalog

    Product observation · Confirmed on:

    Public JSON at proxy302.com/v1/proxy/ai-isp/catalog, read 4 November 2026: three tiers (Claude, GPT / Grok, Gemini), price per 30 days in PTC, 50% off the first order in a tier, cities by country.

  13. proxy302-mcp README (official Proxy302 MCP server)

    Product observation · Confirmed on:

    README of the official Proxy302 MCP server: install commands, environment variables, the seven tools, the read-only, spend-free scope and the hosted endpoint https://proxy302.com/v1/mcp.

Ready to connect?

Create an account, top up once and pick rotating residential, static ISP or datacenter. Rotating residential exits cover 195+ countries and regions.