Fix Playwright ERR_PROXY_CONNECTION_FAILED
Fix net::ERR_PROXY_CONNECTION_FAILED in Playwright and Puppeteer when launching headless Chromium with rotating HTTP or SOCKS5 residential proxies.
1. Quick Wire-Level Diagnostic Probe
Confirm proxy reachability and credentials from the exact host/container running Playwright before debugging Chromium flags (gate.proxytee.com:8080 is a sample placeholder).
curl -I -x http://USER:PASS@gate.proxytee.com:8080 https://example.comCommon Symptoms
- page.goto() crashes with net::ERR_PROXY_CONNECTION_FAILED at .../
- Same proxy works in cURL or Python Requests but fails inside Chromium
- Browser launches cleanly in non-proxy mode but hangs or fails with proxy enabled
2. Primary Root Causes
Authenticated SOCKS5 Unsupported in Chromium
Chromium/Playwright rejects username/password auth over socks5:// endpoints, throwing ERR_PROXY_CONNECTION_FAILED or ERR_NO_SUPPORTED_PROXIES.
Docker / Cloud IP Not Whitelisted
Running Playwright in ephemeral containers or GitHub Actions without user:pass credentials fails IP whitelist checks.
Typo or Inline Credentials in server Field
Playwright expects server='http://host:port' cleanly with username and password passed as separate object properties.
3. Step-by-Step Remediation Checklist
Pass HTTP Proxy With Separate Auth Keys
Use server: 'http://host:port', username: '...', password: '...' inside browser.newContext({ proxy }) or chromium.launch({ proxy }).
Use IP Whitelist Mode for SOCKS5 in Chromium
If your target requires SOCKS5 in Chromium, whitelist your server IPv4 in the ProxyTee dashboard (or API) and omit username/password.
Enable Per-Context Proxy Routing
In Playwright, pass distinct ProxyTee ports per browser.newContext() instead of restarting Chromium for every worker.
4. Production Fix Code (Playwright (Node.js) Proxy Context Setup Without Connection Errors)
javascriptimport { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
proxy: {
server: 'http://gate.proxytee.com:8080',
username: 'your_username',
password: 'your_password',
},
});
const page = await context.newPage();
await page.goto('https://api.ipify.org?format=json', { waitUntil: 'domcontentloaded' });
console.log(await page.textContent('body'));
await browser.close();Recommended Next Steps for Zero-Block Execution
Other Network & Proxy Error Runbooks
ERR_PROXY_CONNECTION_FAILED Troubleshooting FAQs
Chromium's network stack intentionally omits SOCKS5 username/password authentication. Use ProxyTee's HTTP/HTTPS endpoint with username/password, or switch to IP Whitelist mode for SOCKS5.