Playwright proxy authentication, one static IP per context

Updated:

A Playwright proxy is configured with a proxy object holding server, username and password, and Playwright answers the proxy's 407 challenge itself, with no extension or wrapper. Set it on launch() to cover the whole browser, or on newContext() to give each isolated context a different ProxyV4 IP inside one browser process. The same keys work for Chromium, Firefox and WebKit, from Node.js or Python.

Playwright · HTTP Proxy Format
proxy={ server: 'http://ip:port', username: 'user', password: 'pass' }

The proxy object, key by key

KeyExample valueNotes
server'http://ip:port'Address and port only; credentials do not go in this string
username'user'The username from your ProxyV4 order
password'pass'Sent automatically when the proxy replies 407
bypass'localhost,127.0.0.1'Optional list of hosts that should skip the proxy

Browser-wide or per context

Passing proxy to chromium.launch() sends every page of that browser through one IP, which suits a single job with a single identity. Passing it to browser.newContext() is the multi-account pattern: each context has its own cookies, storage and proxy, so one Chromium process can hold several sessions that each show a different exit address.

Because every ProxyV4 private IPv4 is rented to one customer and keeps its address on renewal, you can map context names to IPs in config and reuse that mapping run after run; a site that saw account A on a given IP last week sees the same IP today.

Details that keep contexts consistent

  • Some Playwright and Chromium combinations on Windows and macOS refuse per-context proxies unless the browser was launched with a proxy too; launch with the placeholder proxy: { server: 'http://per-context' } and override it in each context
  • Set timezoneId and locale in newContext() to match the proxy's country (for example America/New_York for a US IP, Asia/Ho_Chi_Minh for Vietnam), so the clock and Intl output agree with the IP
  • Block images and fonts with page.route() when you only need text; pages load faster and the run finishes sooner
  • Close contexts you no longer need; each one keeps its own connections open

Step by step

  1. 1

    Split your proxy line

    From the ip:port:user:pass line in your ProxyV4 order, take ip:port for server and the last two fields for username and password.

  2. 2

    Create a context with the proxy

    Call const context = await browser.newContext({ proxy: { server: 'http://ip:port', username: 'user', password: 'pass' } }).

  3. 3

    Match time zone and language

    Add timezoneId and locale for the proxy's location to the same newContext() options.

  4. 4

    Load the IP endpoint

    Open const page = await context.newPage(), go to https://proxyv4.com/api/my-ip and check that the address shown is the proxy IP. Running a WebRTC leak test in the same context is a useful second check.

Frequently asked questions

Playwright says 'Proxy is only supported when browser is launched with a proxy'. How do I fix it?

On Windows and macOS, Chromium can require a launch-level proxy before it accepts per-context ones. Launch with chromium.launch({ proxy: { server: 'http://per-context' } }), then give each browser.newContext({ proxy }) the real address and login.

Does the same proxy setup work in Firefox and WebKit?

Yes. proxy: { server, username, password } is shared by all three engines and by the Node.js and Python APIs, so only the launcher (firefox, webkit) changes.

Will headless browsers use up a traffic quota?

Not on ProxyV4 private IPv4 or static ISP plans; bandwidth on both is unlimited, so heavy pages do not cost extra.

Pages fail with a tunnel error instead of loading. What should I check?

Confirm that server uses http:// and the right port, and that the proxy is still active in your dashboard. The tunnel connection guide covers the remaining causes.

One private IP per Playwright context

HTTP(S) proxies with user and password in 7 countries, unmetered, same address on renewal.

Check live US prices

Related articles

Proxies by platform
Proxies for web scraping: a fixed pool of IPs with unmetered traffic
Web scraping proxies for Python, Scrapy, Playwright and Selenium: a pool of private IPv4 and static ISP addresses, unlimited bandwidth, flat per-IP pricing.
Proxy setup
Puppeteer with an authenticated proxy: launch flag plus login
Point Puppeteer at an HTTP(S) proxy with --proxy-server, log in with page.authenticate() on every tab, and run several IPs in one Chrome via browser contexts.
Proxy setup
Selenium WebDriver and authenticated proxies: what works
Selenium proxy auth for ChromeDriver: why --proxy-server ignores user:pass, how selenium-wire or an onAuthRequired extension fixes it, and how to verify the IP.
Proxy setup
Python requests through an authenticated proxy, step by step
Send Python requests through an authenticated HTTP(S) proxy: build the proxies dict, attach it to a Session, encode odd passwords, rotate a list, check the IP.
Proxies by platform
Proxies for SEO rank tracking: see the results page a local searcher sees
SEO rank tracking proxies with a private IPv4 in the US, UK, Vietnam, Japan and four more markets, so rankings, local packs and ads match what locals see.
Proxies by platform
Shopee proxies for multi-store sellers working in Vietnam and Singapore
Shopee proxies for sellers running several stores in Vietnam or Singapore: a static ISP or private IPv4 per shop, so Seller Center never sees two stores as one.
IPV4 · united states
Build a US IP Pool for Scraping, Rank Tracking and Ad Checks
Buy US private IPv4 proxies: static American datacenter IPs, one customer per IP, unlimited bandwidth. Built for scraping, SERP tracking and US ad checks.
ISP · vietnam
Consumer-Registered Vietnamese IPs for Main Shops and Ad Accounts
Vietnam static ISP proxies on IPs registered to Vietnamese consumer providers. A fixed IP for main Shopee shops, TikTok Shop, Facebook ad accounts and Zalo OA.