Connect Playwright to Proxidize
Generate an HTTP proxy endpoint in the Proxidize dashboard, then store its hostname, port, username, and password outside the application code. The examples below use one proxy per browser context so separate workers can have separate routing and session state.
The server value describes the connection to the proxy. Use the exact http:// or https:// scheme shown for the access point in the Proxidize dashboard, even when Playwright will open an HTTPS destination through it.
Python
Node.js
Install Playwright and its browser before running either example. The complete Playwright proxy guide contains pinned installation commands, full projects, Docker examples, and asynchronous Python and TypeScript versions.
Choose Browser-Level or Context-Level Proxy Scope
Set the proxy on the browser when every page and context should share one route. Set it on a browser context when workers or workflows need separate exits, cookies, storage, or session boundaries.
Context-level configuration is the safer default for concurrent automation because it keeps the proxy identity and browser state together. Create a new context when changing proxies instead of changing the network identity halfway through a stateful task.
Use Rotating and Sticky Sessions Deliberately
Use random rotation for independent observations that do not need one exit across multiple requests. Use sticky behavior for login flows, pagination, carts, or other permitted multi-step workflows that depend on temporary continuity.
Keep one sticky proxy session, one browser context, and its cookies together until the workflow finishes. Close the context before starting the next routing identity. Rotation is not a substitute for destination-aware pacing, bounded concurrency, or compliance with applicable laws and third-party terms.
Verify the Browser's Visible Exit IP
Test the visible IP inside the Playwright page. A separate Python requests call, Node.js fetch call, or terminal command does not prove that the browser is using the same network path.
Compare the result with a direct request from the automation host. If the addresses match, review the proxy scope, endpoint, credentials, and any bypass rules before accessing the target.
Troubleshoot Common Playwright Proxy Errors
- A 407 response normally means the proxy rejected or did not receive the credentials. Copy the generated values again and keep username and password in their dedicated fields.
- ERR_PROXY_CONNECTION_FAILED normally points to a wrong hostname or port, an unreachable endpoint, a firewall rule, or container routing.
- ERR_TUNNEL_CONNECTION_FAILED can indicate the wrong protocol or a failed HTTPS CONNECT tunnel.
- A navigation timeout does not identify the failing layer. Test the endpoint with cURL, then test the IP-check page, and only then test the intended website.
- Playwright supports SOCKS5 endpoints, but its built-in username and password fields are for HTTP proxy authentication. Use a supported IP-allowlisted SOCKS5 configuration or an authenticated HTTP endpoint.
The Playwright network documentation describes browser-wide and context-level proxy configuration. For a deeper diagnostic flow, use the complete Proxidize guide linked above.
Production Checklist
- Keep credentials in environment variables or a secret manager.
- Verify the visible exit IP from inside the page.
- Match one stateful context to one sticky proxy session.
- Rotate only at an intentional workflow boundary.
- Bound browser concurrency, retries, and queue size.
- Keep TLS verification enabled.
- Exclude credentials, cookies, storage state, traces, and sensitive logs from source control.
- Test the intended protocol, location, session mode, and target behavior before scaling.