Guide · Scraping practice
How to fix net::ERR_TUNNEL_CONNECTION_FAILED in Chrome, Puppeteer and Playwright
net::ERR_TUNNEL_CONNECTION_FAILED means Chrome asked the HTTP proxy to open a tunnel with CONNECT and the proxy answered with something other than 200. Chromium's source handles exactly two answers: 200 opens the tunnel and 407 starts proxy authentication; every other status becomes this error, and Chrome throws away the proxy's explanation. The usual causes are a port that is not a proxy, a proxy that cannot reach the site (502), or a local forwarder such as proxy-chain that turns a rejected password into its own status code. Find the real status with curl -v, then pass the proxy to the browser with Playwright's proxy option.
Reviewed 2 Nov 2026
The short answer
- The error is raised for any CONNECT answer other than 200 or 407. We reproduced it with 501 (a web server, not a proxy), 502 (proxy could not reach the site) and 597 (proxy-chain reporting a wrong upstream password).
- A plain 407 did not produce it in Chromium 156: Chrome 156.0.8078.74 reported
ERR_INVALID_AUTH_CREDENTIALS, and the headless shell under Playwright waited until the navigation timed out. - Chrome hides the proxy's response body on purpose.
curl -v -xagainst the same proxy shows the status line Chrome saw. - Fix for Playwright:
proxy={"server": "http://host:port", "username": ..., "password": ...}. Credentials inside the server URL are not used. - Run the proxy through the free proxy tester first. If it fails there, the problem is the credentials or the endpoint, not your browser code.
What ERR_TUNNEL_CONNECTION_FAILED means
For an HTTPS page behind an HTTP proxy, Chrome first sends CONNECT example.com:443 to the proxy. RFC 9110 says any 2xx answer turns the connection into a tunnel; anything else means no tunnel was formed. The HTTP CONNECT glossary entry shows the exchange.
Chromium's HttpProxyClientSocket has a three-way switch on the status: 200 continues, 407 goes to the authentication code, and the default branch returns ERR_TUNNEL_CONNECTION_FAILED. A comment there explains why the body is ignored: a proxy must not be able to impersonate the target site. It adds that real proxies put useful messages in 403, 404 and 501 bodies, which you therefore never see in the browser.
Chromium's error list defines it as error -111: a tunnel connection through the proxy could not be established. It is a proxy-side failure. The website never received a request.
Causes we reproduced, and what each one looks like
Reproduced on 2026-11-02 with Playwright 1.64.1 driving Chromium 156.0.8078.4 and Google Chrome 156.0.8078.74, and with puppeteer-core 25.16.0 on Node 22.14.0, against local test proxies. Both browsers gave the same result in every row except the two 407 rows.
| Setup | Proxy's answer to CONNECT | What the browser reported |
|---|---|---|
| Proxy URL points at a web server, not a proxy (wrong port) | 501 Unsupported method ('CONNECT') | net::ERR_TUNNEL_CONNECTION_FAILED |
| Proxy is up but cannot reach the site (DNS failure upstream) | 502 Bad Gateway | net::ERR_TUNNEL_CONNECTION_FAILED |
Puppeteer through proxy-chain 3.0.1 anonymizeProxy(), wrong upstream password | 597 UPSTREAM407 from the local forwarder | net::ERR_TUNNEL_CONNECTION_FAILED |
| Proxy closes the connection without answering | Nothing | net::ERR_EMPTY_RESPONSE |
| Nothing listening on that host and port | Connection refused | net::ERR_PROXY_CONNECTION_FAILED |
https:// scheme for a plain HTTP proxy | 400 to the TLS handshake | net::ERR_PROXY_CONNECTION_FAILED |
| 407, no credentials given | 407 + Proxy-Authenticate | Chrome 156.0.8078.74: net::ERR_INVALID_AUTH_CREDENTIALS; headless shell via Playwright: Page.goto: Timeout (no error) |
407, wrong password in Playwright's proxy option | 407 | Chrome 156.0.8078.74: net::ERR_HTTP_RESPONSE_CODE_FAILURE; headless shell: Page.goto: Timeout |
407, wrong password in Puppeteer page.authenticate() | 407 | page.goto() resolved with status 407 (no exception) |
Credentials inside --proxy-server | No request sent | net::ERR_NO_SUPPORTED_PROXIES, see that guide |
The proxy-chain row explains many Puppeteer reports. proxy-chain documents its own 590-599 statuses, with 597 meaning incorrect upstream credentials. Chrome only sees a non-200 answer from 127.0.0.1 and reports a tunnel failure, so a wrong password at the real proxy looks like a network problem.
Find the real status with curl
Because the browser drops the proxy's answer, ask the proxy directly with the same host, port and credentials. curl prints the CONNECT exchange with -v, and -w '%{http_connect}' prints just the status the proxy returned.
Read the number: 407 means credentials (see curl: (56) CONNECT tunnel failed, response 407); 501, 400 or 404 mean the port is not a proxy; 502 or 503 mean the proxy could not reach the site, so retry later or check the hostname; 000 with curl exit 7 means nothing is listening. A proxy that passes the proxy tester and returns 200 here is fine, and the problem is in how the browser is launched.
The fix in Playwright and Puppeteer
- Playwright: pass
server,usernameandpasswordas separate fields of theproxylaunch option. Playwright documentsusernameandpasswordfor HTTP proxies. With the right values our test page loaded with status 200. - Puppeteer: launch with
--proxy-server=http://host:port(no credentials in it) and callpage.authenticate({ username, password })beforegoto. Puppeteer turns on request interception to do this. - proxy-chain: if you keep it, check the upstream URL and password it was given. A 597 is a credentials problem, not a network one.
- Scheme: use
http://for the proxy even though the site is HTTPS. ARC connection strings arehttp://USERNAME:PASSWORD@proxy.arcproxies.io:8000; the Playwright and Puppeteer guides have the full setup with sticky sessions. - Error handling: a wrong password may not throw. Check the response status and the page URL after
goto, and stop on 407 instead of retrying.
Code
Worked example
curl -v -o /dev/null -w 'CONNECT answered: %{http_connect}\n' \ -x "http://USERNAME_pool-arcfast_country-de:PASSWORD@proxy.arcproxies.io:8000" https://example.com/# Reproduced locally on 2026-11-02, curl 8.7.1:# port pointing at a web server -> curl: (56) CONNECT tunnel failed, response 501# proxy cannot reach the site -> curl: (56) CONNECT tunnel failed, response 502# proxy-chain, wrong upstream pw -> curl: (56) CONNECT tunnel failed, response 597from playwright.sync_api import sync_playwrightwith sync_playwright() as p: browser = p.chromium.launch(proxy={ "server": "http://proxy.arcproxies.io:8000", # no user:pass@ in here "username": "USERNAME_pool-arcfast_country-de", "password": "PASSWORD", }) page = browser.new_page() response = page.goto("https://example.com/") if response is None or response.status == 407: raise SystemExit("proxy rejected the credentials") print(response.status) browser.close()import puppeteer from 'puppeteer';const browser = await puppeteer.launch({ args: ['--proxy-server=http://proxy.arcproxies.io:8000'] });const page = await browser.newPage();await page.authenticate({ username: 'USERNAME_pool-arcfast_country-de', password: 'PASSWORD' });const res = await page.goto('https://example.com/');if (res.status() === 407) throw new Error('proxy rejected the credentials');console.log(res.status());await browser.close();FAQ
Questions
Something not covered? Write to contact@arcproxies.io.
What does net::ERR_TUNNEL_CONNECTION_FAILED mean?
Chrome sent a CONNECT request to an HTTP proxy to open a tunnel to an HTTPS site, and the proxy answered with a status other than 200 or 407. No tunnel was opened and the site never saw the request. Chrome does not show the proxy's status or message, so check it with curl -v.
Does ERR_TUNNEL_CONNECTION_FAILED mean my proxy password is wrong?
Not directly. In our tests with Chromium 156 a plain 407 gave ERR_INVALID_AUTH_CREDENTIALS, a 407 response or a timeout, depending on the browser build and tool. A wrong password shows up as ERR_TUNNEL_CONNECTION_FAILED when something in between converts the 407, such as proxy-chain, which answers 597.
Why does Puppeteer show ERR_TUNNEL_CONNECTION_FAILED with proxy-chain?
proxy-chain runs a local proxy that forwards to your real one. If the upstream rejects the credentials, proxy-chain answers Chrome with 597 UPSTREAM407, and Chrome reports any non-200, non-407 answer as a tunnel failure. Fix the upstream username or password, or drop proxy-chain and use page.authenticate.
What is the difference between ERR_TUNNEL_CONNECTION_FAILED and ERR_PROXY_CONNECTION_FAILED?
ERR_PROXY_CONNECTION_FAILED means Chrome could not talk to the proxy at all: nothing listening, wrong host, or a TLS handshake with a plain HTTP proxy. ERR_TUNNEL_CONNECTION_FAILED means the proxy answered the CONNECT request but refused to open the tunnel.
How do I pass a proxy username and password to Playwright?
Use the proxy launch option with separate fields: server set to http://host:port, plus username and password. A username and password written inside the server URL are not used.
Will retrying fix ERR_TUNNEL_CONNECTION_FAILED?
Only for 502 or 503 answers, where the proxy could not reach the site at that moment. A 501, 400 or 404 means the port is wrong, and a 597 from proxy-chain means the credentials are wrong; retrying those changes nothing.
Sources & review
Last reviewed by the ARC Proxies team. Prices are read from the live catalog at build time.
- [1]Chromium: net/http/http_proxy_client_socket.cc (CONNECT response handling)
- [2]Chromium: net/base/net_error_list.h
- [3]IETF: RFC 9110: HTTP Semantics, 9.3.6 CONNECT
- [4]Playwright: BrowserType.launch: proxy option
- [5]Puppeteer: Page.authenticate() method
- [6]proxy-chain 3.0.1: README: Error status codes (597 Auth Failed)
- [7]curl: curl man page (--proxy, --proxy-user, -w http_connect)
Next
Where to go from here
Guides