How to set up a proxy in Playwright (Browser & Per-Context Auth)

Updated:

Playwright supports native HTTP proxy authentication (server, username, password) out of the box across Chromium, Firefox, and WebKit—no browser extensions or third-party wrappers required. Even better, Playwright's Per-Context Proxy feature lets a single browser instance run dozens of isolated BrowserContext sessions, each bound to its own VinaProxy static IP.

Playwright · HTTP Proxy Format
proxy={ server: 'http://ip:port', username: 'user', password: 'pass' }
Private IPv4 (datacenter)
🇺🇸 United States
Available
From
₫20,000 / IP / month
≈ $0.74 · billed in VND
Volume pricing
  • 1 IP₫40,000
  • 5+ IPs₫35,000
  • 10+ IPs₫25,000
  • 20+ IPs₫25,000
  • 50+ IPs₫25,000
  • 100+ IPs₫25,000
  • 200+ IPs₫25,000
  • 500+ IPs₫25,000
  • 1000+ IPs₫22,000
  • 2000+ IPs₫20,000
Buy United States
Static residential ISP
🇻🇳 Vietnam
Available
From
₫25,000 / IP / month
≈ $0.93 · billed in VND
Volume pricing
  • 1 IP₫50,000
  • 3+ IPs₫40,000
  • 5+ IPs₫40,000
  • 10+ IPs₫32,000
  • 50+ IPs₫30,000
  • 100+ IPs₫30,000
  • 200+ IPs₫30,000
  • 500+ IPs₫25,000
Buy Vietnam

Playwright proxy object configuration

Pass the proxy configuration object either globally in chromium.launch({ proxy }) or per session in browser.newContext({ proxy }):

Playwright KeyValue FormatTechnical Note
server'http://ip:port'Host and port only, prefixed with http://
username'user'Your VinaProxy proxy username
password'pass'Your VinaProxy proxy password (handled natively on HTTP 407)
bypass'localhost,127.0.0.1'Optional comma-separated hosts that bypass the proxy

Running multi-IP BrowserContexts efficiently

  • On Windows and macOS, pass a placeholder proxy: { server: 'http://per-context' } inside chromium.launch() whenever you intend to override proxy inside individual browser.newContext() calls
  • Set timezoneId and locale in browser.newContext() alongside your proxy so headers and JS Intl APIs match the proxy country
  • Abort unnecessary image and font requests with page.route() to speed up scraping throughput

Step by step

  1. 1

    Extract ip, port, username, and password

    Copy your ip:port:user:pass credentials from the VinaProxy dashboard.

  2. 2

    Pass the proxy object to newContext()

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

  3. 3

    Align timezoneId and locale

    Include timezoneId and locale matching your proxy location (e.g., America/New_York or Asia/Ho_Chi_Minh).

  4. 4

    Verify exit IP on a new page

    Open const page = await context.newPage() and request https://vinaproxy.com/api/my-ip.

Frequently asked questions

Why did Playwright throw 'Proxy is only supported when browser is launched with a proxy'?

On Windows and macOS, Chromium requires a global launch proxy flag before allowing per-context overrides. Launch the browser with chromium.launch({ proxy: { server: 'http://per-context' } }) and then pass the real proxy to each browser.newContext({ proxy }).

Do VinaProxy proxies work with Playwright Firefox and WebKit too?

Yes. The exact same proxy: { server, username, password } syntax works across Chromium, Firefox, and WebKit in both Node.js and Python.

Is bandwidth metered when running headless Playwright browsers?

No. All VinaProxy Dedicated IPv4 and Static ISP plans include unlimited monthly traffic.

Scale Playwright BrowserContexts with dedicated static IPs

Instant unmetered HTTP(S) proxies across 7 global locations.

Buy Playwright Proxies

Related articles

Proxies by platform
Proxies for Web Scraping: unmetered dedicated IPv4 & ISP pools for 24/7 crawlers
High-speed HTTP(S) dedicated IPv4 and Static ISP proxies for Python, Playwright, Selenium, and Scrapy with unlimited monthly bandwidth.
Proxy setup
How to set up an authenticated proxy in Puppeteer (Node.js)
Configure authenticated HTTP(S) proxies in Node.js Puppeteer using the --proxy-server launch flag and await page.authenticate().
Proxy setup
How to set up an authenticated proxy in Selenium WebDriver
Configure username:password authenticated HTTP(S) proxies in Selenium WebDriver using selenium-wire or a Chrome onAuthRequired extension.
Proxy setup
How to use a proxy in Python Requests (HTTP/HTTPS & Session pooling)
Configure authenticated HTTP(S) proxies in Python requests and requests.Session(). Handle 407 ProxyError exceptions and rotate static IP pools.
Proxies by platform
Proxies for SEO & SERP Tracking: accurate keyword rankings across 7 countries
Track localized keyword rankings, audit geo-redirects, and run Screaming Frog crawls with unmetered dedicated IPv4 and Static ISP proxies.
Proxies by platform
Proxies for Shopee: isolate every Seller Center storefront on a static IP
Manage multiple Shopee Seller Center stores safely without linked-account bans. Dedicated Vietnam Static ISP and private IPv4 proxies.
IPV4 · united states
US Private IPv4 Proxies: Fast, Dedicated American Datacenter IPs
Dedicated US private IPv4 proxies for scraping, rank tracking, ad checks and Amazon research. Static IP, one user per IP, unlimited bandwidth, fast activation.
ISP · vietnam
Vietnam Static ISP Proxies: Home-Network Vietnamese IPs for Your Most Valuable Accounts
Vietnam static ISP proxies on consumer internet provider IPs. A fixed Vietnamese IP for main Shopee shops, TikTok Shop, Facebook ad accounts and Zalo OA.