If you build automation, testing, or web data pipelines with Playwright, you’ll eventually need reliable proxy routing to reduce blocks, manage geo testing, and protect infrastructure. This tutorial shows exactly How to use Playwright with Proxies, test your IP, add authentication, switch between HTTP and SOCKS5, use sticky vs rotating sessions, and troubleshoot common errors. You’ll also get a quick provider comparison, a 7–14 day evaluation plan, and current anti-bot trends to watch.
Recommendations at a glance
- Start simple: pass proxy.server, username, and password to Playwright’s launch or per-context options; verify via httpbin or ipify before real targets.
- Prefer HTTPS end-to-end; proxies don’t encrypt by default—TLS (SSL) does.
- Rotate when needed, stay sticky when you must: use static/ISP for logins and carts; rotate residential for broad scraping.
- Measure what matters: success rate, TTFB, block/ban codes, and support SLAs. Run A/B tests across providers.
- Keep it compliant: document your legal basis, respect site terms, and ensure KYC/data ethics are satisfied.
How to use Playwright with Proxies: quick comparison (2025)
Provider comparison (network types, protocols, geo, compliance, and fit)
| Provider | Network Types | Geo Targeting | Protocols | Compliance | Pricing Model | Best For |
|---|---|---|---|---|---|---|
| Oculus Proxies | Residential, ISP, Datacenter | Country, City, State, ASN, ZIP | HTTP/S, SOCKS5 | ToS/KYC + Acceptable Use | Datacenter from $0.10/GB, Residential from $0.72/GB | Setup simplicity; mixed workloads needing region flexibility |
| Bright Data | Residential, ISP, Datacenter, Mobile | Country, City, ASN | HTTP/S, SOCKS5 | Compliance program | Datacenter from $0.90/GB, Residential from $2.50/GB | Enterprise-scale targeting and datasets |
| ASocks | Residential, Mobile | Country, City | HTTP/S, SOCKS5 | ToS/AUP | Datacenter from $0.65/GB, Residential from $0.75/IP | Budget-friendly residential/mobile with simple setup |
| SOAX | Residential, ISP, Datacenter, Mobile | Country, City | HTTP/S, SOCKS5 | ToS/compliance | Datacenter from $0.40/GB, Residential from $2.00/GB | Precise geo targeting with broad network mix |
| FloppyData | Residential, ISP, Datacenter, Mobile | Country, City | HTTP/S, SOCKS5 | ToS/AUP | Datacenter from $0.60/GB, Residential from $1.00/GB | Low per‑GB rates and quick start across proxy types |
Notes:
- Specs and pricing are publicly stated by each provider and may change by commitment, traffic volume, or promotions. Always verify current pricing on the linked pages.
- Checked: November 2025.
Official pages:
- Oculus Proxies pricing: https://oculusproxies.com/pricing
- Bright Data pricing: https://brightdata.com/pricing
- ASocks pricing/compare: https://asocks.com/compare/
- SOAX pricing: https://soax.com/pricing
- FloppyData pricing: https://floppydata.com/pricing
How to use Playwright with Proxies: step-by-step
- Oculus Proxy types and when to use them
- ISP Proxy (Shared): Residential-origin IPs with ISP allocation for high stability. Good for consistent Telegram sessions, multi-account workflows, and reputation continuity.
- ISP Premium Proxy (Dedicated): Dedicated IPs and higher stability/speeds for reliability‑sensitive tasks and stricter geo gates.
- Events & E‑commerce ISP Proxy: Tuned for ticketing/e‑commerce flows and high‑traffic events.
- Dedicated Datacenter Proxy (Shared/Dedicated): Lowest latency and predictably fast throughput; ideal for controlled infrastructure and internal QA.
- Residential Rotating Proxy: Automatic IP rotation for diversity and resilience; helpful against rate limits.
- Sneakers Residential Proxy: Targeted at time-sensitive drop events; pairs with task schedulers.
- Events Tickets Residential Proxy: Built for popular ticket platforms and surges.
- 1) Install prerequisites
- Node.js: https://nodejs.org/
JavaScript/TypeScript:
npm install playwright npx playwright installPython (optional):
pip install playwright playwright install - 2) Get your Oculus credentials
- Log in: https://oculusproxies.com/dashboard/page/plans
- Copy Host, Port, Username, Password.
- 3) JavaScript/TypeScript: global proxy at browser launch (HTTP/HTTPS)
Playwright supports authenticated proxies at browser launch.
const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch({ headless: true, proxy: { server: 'http://HOST:PORT', // or https:// username: 'USERNAME', password: 'PASSWORD', }, }); const context = await browser.newContext(); const page = await context.newPage(); await page.goto('https://httpbin.org/ip', { waitUntil: 'domcontentloaded' }); console.log(await page.textContent('pre')); await browser.close(); })(); - 4) JS/TS: SOCKS5 proxy
Use the socks5:// scheme when your plan supports it.
const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch({ proxy: { server: 'socks5://HOST:PORT', username: 'USERNAME', password: 'PASSWORD', }, }); const page = await (await browser.newContext()).newPage(); await page.goto('https://api.ipify.org?format=json'); console.log(await page.textContent('body')); await browser.close(); })(); - 5) JS/TS: per-context proxies for multi-geo tests
Run different geos in parallel with separate contexts.
const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch({ headless: true }); const ctxUS = await browser.newContext({ proxy: { server: 'http://US_HOST:PORT', username: 'USER_US', password: 'PASS_US' }, }); const ctxDE = await browser.newContext({ proxy: { server: 'http://DE_HOST:PORT', username: 'USER_DE', password: 'PASS_DE' }, }); const [pageUS, pageDE] = [await ctxUS.newPage(), await ctxDE.newPage()]; await Promise.all([ pageUS.goto('https://httpbin.org/ip'), pageDE.goto('https://httpbin.org/ip'), ]); console.log('US:', await pageUS.textContent('pre')); console.log('DE:', await pageDE.textContent('pre')); await browser.close(); })(); - 6) Python equivalents
HTTP(S):
from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch( headless=True, proxy={ "server": "http://HOST:PORT", "username": "USERNAME", "password": "PASSWORD", }, ) page = browser.new_page() page.goto("https://httpbin.org/ip", wait_until="domcontentloaded") print(page.text_content("pre")) browser.close()SOCKS5:
from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch( proxy={ "server": "socks5://HOST:PORT", "username": "USERNAME", "password": "PASSWORD", } ) page = browser.new_page() page.goto("https://api.ipify.org?format=json") print(page.text_content("body")) browser.close()Per-context:
from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch() ctx_us = browser.new_context(proxy={"server": "http://US_HOST:PORT", "username": "USER_US", "password": "PASS_US"}) ctx_de = browser.new_context(proxy={"server": "http://DE_HOST:PORT", "username": "USER_DE", "password": "PASS_DE"}) p_us = ctx_us.new_page() p_de = ctx_de.new_page() p_us.goto("https://httpbin.org/ip") p_de.goto("https://httpbin.org/ip") print("US:", p_us.text_content("pre")) print("DE:", p_de.text_content("pre")) browser.close() - 7) Sticky vs rotating with Oculus Proxies
- Sticky (ISP, Dedicated ISP, Dedicated Datacenter): keep the same IP for carts, logins, and multi-step flows; reduce re-auth prompts.
- Rotating (Residential Rotating; Shared variants): new IP per request/session to distribute load and minimize fingerprint clustering on scrape-heavy tasks.
Tip: If your account supports session parameters (e.g., session IDs for sticky IPs), keep a stable session for 10–30 minutes and refresh if performance degrades.
- 8) Troubleshooting tips
- 407 Proxy Authentication Required: re-check username/password; confirm protocol matches (HTTP vs SOCKS5).
- 403/429 or CAPTCHAs: slow your rate, add random think time, diversify UAs, and use sticky sessions for authenticated flows. Verify IP geo matches expectations.
- TLS/handshake failures: ensure the scheme matches the proxy (http:// vs socks5://). Proxies do not encrypt; HTTPS/TLS does.
- Verify IP via CLI quickly:
curl -x http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org
How to test providers (7–14 days)
A practical evaluation checklist to run across 2–3 providers:
- Targets and workload
- Pick 3 targets: one easy, one moderate, one with modern bot defenses.
- KPIs: success rate, TTFB, full-page load, ban/error rate, cost per successful request.
- Test design
- Run identical scripts with the same Playwright version, headless mode, and headers.
- Avoid stealth plugins that vary between runs.
- Measurements
- Success rate: 2xx/3xx = success; log 4xx/5xx with status codes and bodies.
- TTFB and total time: capture via performance timing APIs.
- Ban/block signals: 403/429, CAPTCHAs, soft blocks, TLS handshake resets.
- Support responsiveness: open a real ticket (e.g., geo routing) and time first meaningful response.
- Capability checks
- Protocols: verify HTTP(S) and SOCKS5; test auth and no-auth paths.
- Geo accuracy: confirm with ipinfo/ip-api; cross-check server logs where possible.
- Concurrency: ramp 10 -> 100 -> 500 pages; watch error rates and tail latency.
- Session control: validate sticky sessions; test cart/login retention and IP persistence windows.
- Documentation and ethics
- Save HARs, screenshots, and logs.
- Maintain a compliance memo: legal basis, permitted use, and how you honor site terms/robots where applicable.
What’s new in 2024–2025
- Modern anti-bot: TLS fingerprinting (JA3/JA4), canvas/font probes, and behavioral scoring are more common. Plan realistic browser runs with correct pacing and headers. Sources: Salesforce JA3; Fox-IT JA4.
- Protocol support focus: HTTP/HTTPS and SOCKS5 remain the mainstream for proxying browser automation. Verify both in your stack (global vs per-context) and confirm provider support and authentication details. Source: Playwright docs.
Industry use cases
- E-commerce testing and monitoring: Validate price, availability, and cart flows from multiple countries (sticky ISP).
- SEO and rank tracking: Fetch SERPs/landing pages from specific regions; rotate residential proxies to spread traffic.
- Ad verification: Confirm ad delivery and creative rendering across geos using parallel contexts with different proxies.
- Market research and QA: Collect structured sections and confirm UI behavior across locales.
- AI/ML data collection: Capture public signals with respectful pacing and clear compliance documentation.
FAQs: choosing a Playwright proxy setup
- Do proxies encrypt my traffic by default?
No. Proxies forward traffic. Encryption comes from HTTPS (TLS). Use https:// whenever possible. - What proxy types should I know?
Residential (rotating/static), ISP (shared/dedicated), Datacenter (shared/dedicated), and Mobile. ISP/static are stable and less noisy; rotating residential is stealthy for broad collection; datacenter is fast and cost-efficient; mobile is niche and costly. - SOCKS5 vs HTTP/HTTPS?
SOCKS5 is a flexible proxy protocol (TCP, and UDP where applicable) and can include auth. It is not encryption. HTTP/HTTPS proxies are broadly supported and simple for web traffic. - Quick evaluation criteria?
Success rate, TTFB, ban rate, support responsiveness, and cost per successful request. Confirm geo accuracy and concurrency ceilings. - Proxy vs VPN?
A VPN typically routes all device traffic through an encrypted tunnel. A proxy routes selected application traffic. For browser automation, app-level proxies provide finer control.
Why Oculus Proxies
- Coverage: Residential, Shared/Dedicated ISP, and Shared/Dedicated Datacenter networks with country, state, city, ZIP, and ASN targeting across 190+ countries—see the Oculus Proxies products.
- Reliability: 99.99% uptime advertised on the site; supports sticky sessions and rotation controls (see status page, checked November 2025).
- Performance: HTTP/HTTPS and SOCKS5 support; sticky and rotating endpoints; rotation-interval controls; parallel usage patterns—see the Socks5 proxies docs.
- Compliance & Safety: Generally no KYC; some proxies require verification depending on product and use case. Review our Privacy Policy and Terms & Conditions.
- Pricing: Usage-based and monthly tiers—Datacenter from $0.15/GB. See the pricing page.
Notes & Sources
- Playwright docs — Network (HTTP/SOCKS5 proxy, per-browser/per-context): https://playwright.dev/docs/network
- Playwright API — Browser/BrowserType (proxy options and auth): https://playwright.dev/docs/api/class-browsertype and https://playwright.dev/docs/api/class-browser
- Oculus Proxies X Playwright Integration: https://docs.oculusproxies.com/integration-guides/playwright
- Node.js downloads: https://nodejs.org/
- httpbin (IP echo): https://httpbin.org/ip
- ipify API (IP echo): https://api.ipify.org
- JA3 (TLS client fingerprinting): https://github.com/salesforce/ja3
- JA4 (updated TLS/HTTP fingerprinting approach): https://www.fox-it.com/en/insights/blogs/ja4
- Oculus Proxies pricing: https://oculusproxies.com/pricing
- Bright Data pricing: https://brightdata.com/pricing
- ASocks pricing/compare: https://asocks.com/compare/
- SOAX pricing: https://soax.com/pricing
- FloppyData pricing: https://floppydata.com/pricing
Checked: November 2025. Update quarterly.
