---
title: "ERR_PROXY_CONNECTION_FAILED: you never reached the proxy"
description: "ERR_PROXY_CONNECTION_FAILED means Chrome, Puppeteer, Playwright or Selenium never reached your proxy: wrong host, port, scheme or a block. How to fix it."
url: "https://scrapenews.com/errors/err-proxy-connection-failed"
updated: "2026-11-26T00:00:00Z"
---

# ERR_PROXY_CONNECTION_FAILED: you never reached the proxy

Proxy errors · ERR_PROXY_CONNECTION_FAILED

Published 26 Nov 2026

What you see

- `net::ERR_PROXY_CONNECTION_FAILED`
- `Error: net::ERR_PROXY_CONNECTION_FAILED`
- `page.goto: net::ERR_PROXY_CONNECTION_FAILED`
- `playwright._impl._api_types.Error: net::ERR_PROXY_CONNECTION_FAILED`

**More error strings (7)**

- `org.openqa.selenium.WebDriverException: unknown error: net::ERR_PROXY_CONNECTION_FAILED`
- `ProxyError('Unable to connect to proxy', NewConnectionError(`
- `ProxyError('Cannot connect to proxy.'`
- `curl: (7) Failed to connect to`
- `curl: (5) Could not resolve proxy`
- `Error: connect ECONNREFUSED 127.0.0.1:1080`
- `TypeError: fetch failed`

## What it means

Your browser or script never reached the proxy (the middleman server your traffic goes through). Nothing was sent anywhere, so the website never saw you. The fault is the proxy address, or its port, or the road from your computer to it.

## Why it happens

### First: did you reach the proxy at all?

Proxy errors look alike and each one breaks at a different spot. **This one breaks before the proxy says a single word.**

| you see | where it broke | go to |
| --- | --- | --- |
| `net::ERR_PROXY_CONNECTION_FAILED` (-130) | on the way to the proxy: name not found or connection failed | this page |
| `net::ERR_TUNNEL_CONNECTION_FAILED` (-111) | at the proxy: it answered, but would not open the tunnel to the site | [/errors/err-tunnel-connection-failed](https://scrapenews.com/errors/err-tunnel-connection-failed.md) |
| `407 Proxy Authentication Required` | at the proxy: it wants a login | [/errors/407-proxy-authentication-required](https://scrapenews.com/errors/407-proxy-authentication-required.md) |

Chromium’s own comment for -130 says the code does NOT include failures during the `CONNECT` step. A proxy that answers with any status number is a tunnel problem or a login problem, not this one.

### The usual causes, most common first

1. **Wrong host or port.** Chromium’s docs describe this exact case: proxy unreachable, every request fails with `ERR_PROXY_CONNECTION_FAILED`.
2. **The proxy is down.** That includes a local helper proxy on your own machine: in selenium-wire issue #51, the tool’s local proxy refused connections (`ConnectionRefusedError: [Errno 61] Connection refused`), and every new tab gave `ERR_PROXY_CONNECTION_FAILED`.
3. **Wrong scheme.** Without one, Chrome assumes an HTTP proxy. `https://` means Chrome speaks TLS (encryption) to the proxy itself. `socks5://` means a SOCKS proxy. In Puppeteer issue #2472, `--proxy-server=https://IP:Port` failed with this error while curl went through fine.
4. **Your IP isn’t allowed in.** Some providers check your IP instead of a password. ProxyMesh says too many 402, 407 or 408 replies get your IP blocked for 4 to 6 hours, and lists “Connection Refused” and “Cannot Connect to Proxy” among the signs.
5. **A firewall blocks the port on the way out.** ProxyMesh says some hosting providers block traffic going out to its port 31280, and on AWS EC2 you may have to allow it yourself.
6. **Your tool’s proxy setup.** Playwright, Selenium and SOCKS5 logins each have a trap. See Dev details.

Still, not every provider just drops the connection. Bright Data answers an IP that is missing from your zone’s allowlist with error `client_10030`: “not whitelisted in this zone’s settings”. That is an answer, so in a browser it shows up as a tunnel or 407 error rather than this one.

Reaching a proxy takes two small steps. First Chrome turns the proxy’s name into a numeric IP (a DNS lookup). Then it opens a TCP connection (the basic line between two machines) to that IP and port. Either step fails: -130. Chromium’s fallback rules name the same two steps as “connection level failures”.

“Refused” and “timed out” point to different things. Node’s docs say a refused connection usually means no service is listening on that port. A timeout means the other side stayed silent.

IP login has its own traps. ProxyMesh says one IP can’t sit on two accounts since the proxy can’t tell who is sending. Shared office IPs run into it. Its advice: run from your own cloud server. ProxyMesh also says a 408 timeout can reach you as `ERR_PROXY_CONNECTION_FAILED`, so a few of these in a long run may just need a retry.

## Fix it

1. **Copy host, port number and scheme again** from your provider’s dashboard. No typos, no port from another product.
2. **Test the proxy by itself with curl**, outside your code: `curl -v -x http://proxy.example:8080 https://example.com`
   - `curl: (5) Could not resolve proxy: proxy.example`: the proxy’s name is wrong, or DNS cannot find it.
   - `curl: (7) Failed to connect to …`: the port is closed or the proxy is down, or something blocks the way.
   - `CONNECT tunnel failed, response 502` (or some other number): you did reach the proxy. Go to [/errors/err-tunnel-connection-failed](https://scrapenews.com/errors/err-tunnel-connection-failed.md).
   - A `407`: follow [/errors/407-proxy-authentication-required](https://scrapenews.com/errors/407-proxy-authentication-required.md).
3. **Using IP login?** Add your current public IP to the provider’s allowed list. Bright Data calls it “Allowed IPs”. Hit a block after too many errors? ProxyMesh says to wait out the ban.
4. **Open the port on your side.** On a cloud server you have to allow outgoing traffic headed for the proxy’s port in its firewall settings.
5. **curl works, the browser fails?** The proxy is fine, so the bug is how your code passes it in. Check the Playwright and Selenium traps below.
6. **Python, Node or curl fails the same way?** Same cause, different words. See the HTTP clients part of Dev details, or [/errors/python-requests-proxyerror](https://scrapenews.com/errors/python-requests-proxyerror.md) for every requests message.
7. **Don’t “fix” it with `direct://`.** Chrome’s docs show `--proxy-server="http://foo:8080,direct://"` as a fallback. That works, but then your traffic leaves on your own IP.

Why curl first? It takes your code out of the picture: if curl can’t connect either, no Puppeteer or Playwright setting will fix it.

Read the exit code as a place: in libcurl’s list, 5 means it could not resolve the proxy’s name. 7 means it could not connect to the host or proxy. Neither means the proxy said no: a proxy that says no sends a status, and curl prints it.

Our advice: run the same curl from a second network, like a cloud server. Works there? Then the proxy is fine, and the block sits on your side: a firewall rule, or an IP the provider does not know.

About `direct://`: Chrome tries the list left to right. With `direct://` last, a dead proxy sends Chrome to the site itself, and the site sees your real IP. For scraping, a loud error beats a quiet leak.

Paste this into your AI

```
My scraper cannot reach its proxy. The exact error:
"<paste the full error line, including any 'cause' or 'Caused by' part>"
First tell me in plain words: did I fail to reach the proxy at all,
or did the proxy answer and refuse (a tunnel error or a 407)?
Then list the likely causes in order, most likely first.
For each cause, give one quick test and one fix.
Show me a curl -v command that tests my proxy alone, and how to read curl exit codes 5 and 7.
My setup: <Puppeteer / Playwright / Selenium / requests / curl / Node fetch or axios>,
how I pass the proxy (<--proxy-server flag / proxy option / env var HTTP_PROXY / proxies dict>),
proxy URL: <scheme://host:port, no password>,
how the provider checks me (<username+password / my IP on an allowlist>),
where the code runs (<laptop / office network / cloud server / Docker>).
Never ask me to paste my real password.
```

## Dev details

Chromium spells out the code in `net/base/net_error_list.h`:

```cpp
// Could not create a connection to the proxy server. An error occurred
// either in resolving its name, or in connecting a socket to it.
// Note that this does NOT include failures during the actual "CONNECT" method
// of an HTTP proxy.
NET_ERROR(PROXY_CONNECTION_FAILED, -130)
```

How it looks in every browser tool:

```text
Puppeteer:          Error: net::ERR_PROXY_CONNECTION_FAILED at https://example.com/
Playwright (Node):  page.goto: net::ERR_PROXY_CONNECTION_FAILED at http://localhost:8000/
Playwright (Py):    playwright._impl._api_types.Error: net::ERR_PROXY_CONNECTION_FAILED at https://www.example.com/
Selenium (Java):    org.openqa.selenium.WebDriverException: unknown error: net::ERR_PROXY_CONNECTION_FAILED
```

### Schemes and default ports in Chrome

From Chromium’s proxy docs. Leave out the port and Chrome picks the scheme’s default:

| scheme | default port |
| --- | --- |
| `http://` (also the default when you write no scheme) | 80 |
| `https://` | 443 |
| `socks4://` | 1080 |
| `socks5://` | 1080 |

A port such as `8080` with no scheme means “HTTP proxy on 8080”. If that port speaks SOCKS, write `socks5://`.

### Playwright: two traps

**`per-context` with no context proxy.** Issue #9437: starting the browser with `proxy={'server': 'per-context'}` and then calling `new_context()` without a proxy fails on every page. A maintainer explained that `per-context` is a placeholder, and you must set the real proxy on each context:

```js
const browser = await chromium.launch({ proxy: { server: 'per-context' } });
const context = await browser.newContext({
  proxy: { server: 'http://proxy.example:8080', username: 'user', password: 'pass' },
});
```

**localhost goes through the proxy.** Playwright adds Chrome’s `<-loopback>` rule that sends loopback traffic through the proxy, unless you opt out. From `crBrowser.ts`:

```ts
export function shouldProxyLoopback(bypass: string | undefined) {
  if (process.env.PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK)
    return false;
  const hosts = (bypass || '').split(',').map(s => s.trim());
  const shouldBypassSomeLoopback = ['localhost', '127.0.0.1', '::1', '[::]', '[::1]', '<loopback>', '<-loopback>'].some(host => hosts.includes(host));
  return !shouldBypassSomeLoopback;
}
```

So a dummy proxy plus a local test server gives `ERR_PROXY_CONNECTION_FAILED` on `http://localhost:8000/`. The fix is to put `localhost` in `proxy.bypass`.

### Selenium: SOCKS5 with a login

In Selenium issue #12910 (Selenium 4.13.0, Chrome 117), a SOCKS5 proxy with username and password failed both ways: Selenium’s `Proxy` object with `setSocksUsername`, and `--proxy-server=socks5://user:pass@host:port`. Both ended in `ERR_PROXY_CONNECTION_FAILED`. The issue was marked as a ChromeDriver problem. Chromium’s proxy docs are blunt: “No authentication methods are supported for SOCKSv5 in Chrome”. Ask your provider for an HTTP endpoint (more in [/errors/err-tunnel-connection-failed](https://scrapenews.com/errors/err-tunnel-connection-failed.md)).

### HTTP clients: same failure, other words

**Python (requests, urllib3).** urllib3 wraps errors from setting up the proxy connection, tunnel step included, into `ProxyError("Unable to connect to proxy", …)`. Version 1.26 says `Cannot connect to proxy.` instead. Look at the cause inside:

```text
ProxyError('Unable to connect to proxy', NewConnectionError(… Connection refused))   → this page
ProxyError('Unable to connect to proxy. Your proxy appears to only use HTTP and not HTTPS, …')   → https:// on an HTTP proxy: write http://
```

The second one is urllib3 guessing a scheme mismatch based on TLS errors like `wrong version number`. Every other requests message: [/errors/python-requests-proxyerror](https://scrapenews.com/errors/python-requests-proxyerror.md).

**curl.** Two exit codes both mean “never reached the proxy”:

| exit | name | libcurl says |
| --- | --- | --- |
| 5 | `CURLE_COULDNT_RESOLVE_PROXY` | the given proxy host could not be resolved |
| 7 | `CURLE_COULDNT_CONNECT` | failed to `connect()` to host or proxy |

The wording in curl’s current code:

```text
curl: (5) Could not resolve proxy: proxy.example
curl: (7) Failed to connect to example.com:443 over proxy proxy.example after 3 ms: Could not connect to server
```

**Node (fetch/undici, axios).** You get a bare socket error. The undici example below comes from a discussion where `HTTP_PROXY` pointed at a port with nothing running:

```text
TypeError: fetch failed
  [cause]: Error: connect ECONNREFUSED 127.0.0.1:1080
    { errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 1080 }
```

The trick: compare `address` and `port` with your proxy’s. If they match, then the proxy refused you, not the site. What Node’s docs say:

- `ECONNREFUSED`: the other machine actively refused, usually because no service runs there.
- `ENOTFOUND`: the DNS lookup failed (bad proxy host name).
- `ETIMEDOUT`: the other side did not answer within the limit.

### Backup proxies

Chrome takes a comma-separated list in `--proxy-server` and tries the next proxy on a failure. Chromium’s docs say that generally only connection-level failures count, and that is exactly this error. A refused tunnel does not count. Use a second real proxy, not `direct://`.

Chrome remembers which proxies failed. A proxy that fails gets marked bad for the next 5 minutes, and Chrome tries the others first. The failures that count are the ones on this page: a failed DNS lookup for the proxy, or a failed TCP connection to it.

That localhost trap in Playwright starts with a Chrome safety rule. By default Chrome never sends `localhost`, `127.0.0.1/8` or `[::1]` through a proxy, because the web treats localhost as a secure origin. The special rule `<-loopback>` switches that off. Playwright adds it unless your bypass list names a loopback host.

In Node, `address` holds an IP, not a name. The undici asker noticed that a proxy set by host name resolves to an IP, so matching it against your config string can miss. Resolve the name first, or wrap the client: an undici maintainer pointed to a custom `clientFactory` on `EnvHttpProxyAgent`.

## Questions

### What is the difference between ERR_PROXY_CONNECTION_FAILED and ERR_TUNNEL_CONNECTION_FAILED?

ERR_PROXY_CONNECTION_FAILED (-130): Chrome never reached the proxy. Its name did not resolve or the connection failed. ERR_TUNNEL_CONNECTION_FAILED (-111): Chrome reached the proxy, but the CONNECT step that opens the tunnel failed. Chromium's own comment for -130 says it does not cover CONNECT failures.

### Why does Playwright give ERR_PROXY_CONNECTION_FAILED when I launch with proxy server 'per-context'?

'per-context' is only a placeholder. In Playwright issue #9437, a maintainer explained you then have to pass the real proxy to every new context. A context with no proxy fails on every page with this error.

### Why does my localhost test page fail with ERR_PROXY_CONNECTION_FAILED in Playwright?

Playwright sends localhost through your proxy too, unless your bypass list names a loopback address such as localhost or 127.0.0.1, or you set PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK (Playwright source, crBrowser.ts). If that proxy is a dummy or down, localhost fails.

## Related

- [Free proxy for web scraping](https://scrapenews.com/guides/free-proxy-for-web-scraping.md)  (Guide)
- [Rotating proxies](https://scrapenews.com/guides/rotating-proxies.md)  (Guide)
- [Residential proxies](https://scrapenews.com/compare/residential-proxies.md)  (Compare)
- [Proxy checker](https://scrapenews.com/proxy-checker.md)  (Free tool)
- [ERR_TUNNEL_CONNECTION_FAILED and ERR_PROXY_CONNECTION_FAILED](https://scrapenews.com/errors/err-tunnel-connection-failed.md)  (Error)
- [Python requests ProxyError and SSL errors behind a proxy](https://scrapenews.com/errors/python-requests-proxyerror.md)  (Error)

## Tools that get past it

| Tool | Price |
| --- | --- |
| [Axios](https://scrapenews.com/compare/axios.md): Promise-based HTTP client for the browser and Node.js, with request and response interceptors and TypeScript types. | Free |
| [Playwright](https://scrapenews.com/compare/playwright.md): Microsoft's framework to drive Chromium, Firefox and WebKit from code with one API. Made for testing; also used to scrape. | Free |
| [Puppeteer](https://scrapenews.com/compare/puppeteer.md): JavaScript library to control Chrome and Firefox from code. | Free |
| [Requests](https://scrapenews.com/compare/requests.md): The classic simple HTTP library for Python. | Free |
| [Selenium](https://scrapenews.com/compare/selenium.md): Long-standing browser automation framework built on WebDriver, with bindings for many languages. | Free |

## Sources

1. [Chromium source: net_error_list.h (PROXY_CONNECTION_FAILED, -130)](https://chromium.googlesource.com/chromium/src/+/HEAD/net/base/net_error_list.h) chromium.googlesource.com
2. [Chromium docs: Proxy support in Chrome (unreachable proxy, schemes, default ports, direct:// fallback)](https://chromium.googlesource.com/chromium/src/+/HEAD/net/docs/proxy.md) chromium.googlesource.com
3. [puppeteer/puppeteer issue #2472: ERR_PROXY_CONNECTION_FAILED with --proxy-server](https://github.com/puppeteer/puppeteer/issues/2472) github.com
4. [microsoft/playwright issue #9437: ERR_PROXY_CONNECTION_FAILED when server 'per-context' was set but no proxy given](https://github.com/microsoft/playwright/issues/9437) github.com
5. [microsoft/playwright issue #39562: proxy.bypass localhost,127.0.0.1 does not work](https://github.com/microsoft/playwright/issues/39562) github.com
6. [Playwright source: crBrowser.ts (shouldProxyLoopback)](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/chromium/crBrowser.ts) github.com
7. [SeleniumHQ/selenium issue #12910: SOCKS5 proxy with login, WebDriverException net::ERR_PROXY_CONNECTION_FAILED](https://github.com/SeleniumHQ/selenium/issues/12910) github.com
8. [wkeeling/selenium-wire issue #51: ERR_PROXY_CONNECTION_FAILED after clicking any link](https://github.com/wkeeling/selenium-wire/issues/51) github.com
9. [urllib3 source: connection.py (_wrap_proxy_error, 'Unable to connect to proxy')](https://github.com/urllib3/urllib3/blob/main/src/urllib3/connection.py) github.com
10. [urllib3 source: connectionpool.py (wraps errors before the proxy is reached)](https://github.com/urllib3/urllib3/blob/main/src/urllib3/connectionpool.py) github.com
11. [urllib3 1.26.x source: connectionpool.py ('Cannot connect to proxy.')](https://github.com/urllib3/urllib3/blob/1.26.x/src/urllib3/connectionpool.py) github.com
12. [libcurl: error codes (CURLE_COULDNT_RESOLVE_PROXY 5, CURLE_COULDNT_CONNECT 7)](https://curl.se/libcurl/c/libcurl-errors.html) curl.se
13. [curl source: cf-ip-happy.c ('Failed to connect to … over proxy …')](https://github.com/curl/curl/blob/master/lib/cf-ip-happy.c) github.com
14. [curl source: vdns/hostip.c ('Could not resolve proxy')](https://github.com/curl/curl/blob/master/lib/vdns/hostip.c) github.com
15. [curl source: strerror.c (error texts)](https://github.com/curl/curl/blob/master/lib/strerror.c) github.com
16. [Node.js docs: Errors (ECONNREFUSED, ENOTFOUND, ETIMEDOUT)](https://nodejs.org/api/errors.html) nodejs.org
17. [nodejs/undici discussion #4333: Error handling for EnvHttpProxyAgent (proxy down → ECONNREFUSED)](https://github.com/nodejs/undici/discussions/4333) github.com
18. [ProxyMesh Knowledge Base: Proxy Connection Problems](https://docs.proxymesh.com/article/11-proxy-connection-problems) docs.proxymesh.com
19. [Bright Data Docs: Proxy errors troubleshooting (client_10030, IP not on allowlist)](https://docs.brightdata.com/proxy-networks/errorCatalog) docs.brightdata.com

## Up

- [Home](https://scrapenews.com/index.md)
- [Errors & CAPTCHAs](https://scrapenews.com/errors.md)
