Short answers
What does proxy connection refused mean?
Nothing accepted a TCP connection on that host and port. curl reports curl: (7) Failed to connect to … Couldn't connect to server. Check the hostname and the port first: the gateway listens for HTTP on 7000 and for SOCKS5 on 7001.
Is a proxy timeout the same as a refusal?
No. A refusal comes back quickly. A timeout means the connection or the proxy handshake did not finish within your limit, and curl exits with 28. In our tests --connect-timeout also ended the wait for a gateway that accepted the connection but never answered CONNECT or the SOCKS5 greeting.
Why does using the wrong port not show as refused?
Both ports are open, so the TCP connection succeeds before the two protocols disagree. In our tests an HTTP client on the SOCKS5 port failed with curl 56 and a connection reset, and a SOCKS5 client on the HTTP port timed out with 28. Only a closed port produced 7.
Should I turn off certificate checks to get past the error?
No. An HTTP gateway relays CONNECT without terminating TLS, so a certificate error comes from the destination or from something intercepting TLS on your network. Fix the trust or the network and keep verification on.
Why does Firefox say the proxy server is refusing connections?
Firefox is set to use a proxy, through its own settings, the system settings or an extension, and that proxy refused the connection or its HTTPS tunnel request. Check the proxy host and port in Firefox’s Connection Settings, and whether the app that provides a local proxy is running.
I never set a proxy in Firefox. How do I fix it?
In Firefox Settings, search for proxy and open the proxy dialog. Choose No proxy, or keep Use system proxy settings and remove the stale entry from Windows or macOS. If an extension controls the setting, Firefox names it. On a managed device, ask the administrator first.
If Chrome shows ERR_PROXY_CONNECTION_FAILED, use the Chrome connection checklist to identify the browser’s active proxy before comparing it with curl. If the gateway answers but asks for credentials, use the username and password prompt guide. For another message, the proxy error index links each failure to its next check.
Firefox: The proxy server is refusing connections
Firefox shows a page titled The proxy server is refusing connections, with the line Firefox is configured to use a proxy server that is refusing connections. and two suggestions: check the proxy settings, and contact your network administrator. Firefox is set to use a proxy, and that proxy did not accept the connection. Firefox shows the same page when the proxy refuses its request for an HTTPS tunnel with certain statuses, such as 403, 429 or a sign-in (407) it could not complete. Either way, the website was never reached.
Work through these checks in order:
- Open the proxy settings. In Firefox Settings, type
proxyintoFind in Settingsand chooseConfigure proxy; older versions, such as Firefox ESR 115, call this areaNetwork Settings, with aSettings…button. TheConnection Settingsdialog shows the mode in use. - If
Manual proxy configurationis selected, compareHTTP Proxyand itsPortwith the details you were given, as a pair. For Portproof that is gw.portproof.org and 7000, withAlso use this proxy for HTTPSticked. If you no longer use that proxy, chooseNo proxy, orUse system proxy settingsif the computer’s own settings should apply. - If
Use system proxy settingsis selected, Firefox follows the operating system. CheckSettings > Network & internet > Proxyon Windows, orSystem Settings > Network, thenDetails > Proxies, on macOS, and turn off an entry you no longer use. - If the proxy host is
localhostor another name for this computer, the local proxy, VPN or security app that provides it must be running and listening on that port. An entry can outlive the app that created it: start the app, or remove the entry. - Check that each port sits in the field for its protocol: an HTTP proxy port in
HTTP Proxy, a SOCKS port inSOCKS HostwithSOCKS v5. A swapped pair connects and then fails the handshake, so it may show a different error. Portproof uses 7000 for HTTP and 7001 for SOCKS5; for an authenticated connection, use the HTTP fields as in the Firefox setup guide. - Check firewalls and security software. They can block Firefox’s connection to the proxy port while other apps still connect. Run the two probes from the same computer: if curl reaches the gateway and Firefox does not, the difference is on this computer; if both fail, test from another network. Firefox shows the same page when the proxy refuses the tunnel with 403, 407 or 429, so if the probe prints a
connect_status, follow that row of the result table.
If an extension controls the proxy, Firefox says <extension> controls how Firefox connects to the internet and offers Disable Extension. Decide whether you still need that extension before changing the manual settings. On a managed device an administrator can lock these settings; ask them instead of working around the policy.
Unable to find the proxy server
Firefox shows Unable to find the proxy server, with Firefox is configured to use a proxy server that can’t be found., when the proxy’s hostname does not resolve. Check the spelling against your connection details, then your network connection. curl reports the same stage as exit 5, Could not resolve proxy, in the result table.
Firefox wording and behaviour were checked on 6 November 2026 against its error page titles, error descriptions, connection settings labels and error mapping. This is a documentation check, not a recorded browser test.
Where a proxy connection can fail
A request through the gateway passes three stages before your request reaches the destination. Each stage fails in its own way, so name the stage before choosing a fix.
- Reach the gateway
- Your client resolves the gateway hostname and opens a TCP connection to the port. The name may not resolve, the port may refuse, or nothing may answer before the connect timeout.
- Proxy handshake
- The client speaks the proxy protocol: HTTP CONNECT on 7000, or the SOCKS5 greeting and sign-in on 7001. The protocol may not match the port, the credentials may be rejected, or the gateway may accept the connection and not answer.
- Tunnel answer
- An HTTP gateway answers CONNECT with a status. 200 opens the tunnel; any other status means the gateway answered and refused. A 407 belongs to the 407 guide; 403, 502 and 503 belong to the CONNECT tunnel guide.
Only after these stages does TLS start between your client and the destination, inside the tunnel. CONNECT itself is defined in RFC 9110. This guide covers the first two stages, where no tunnel status exists yet.
Run two bounded probes
Copy the complete username from the connection builder and replace YOUR_FULL_PROXY_USERNAME. curl asks for the password; leave it out of the command so it stays out of your shell history. --connect-timeout 10 limits the connection and, in our tests, the proxy handshake too. --max-time 20 limits the whole check.
curl --disable --silent --show-error --noproxy '' \
--connect-timeout 10 --max-time 20 \
--proxy 'http://gw.portproof.org:7000' \
--proxy-user 'YOUR_FULL_PROXY_USERNAME' \
--output /dev/null \
--write-out 'curl_exit=%{exitcode} connect_status=%{http_connect}\n' \
'https://example.com/'Then send the same check to the SOCKS5 port. The socks5h scheme asks the gateway to resolve the destination name, so the lookup happens on the proxy side rather than on your machine. SOCKS5 has no HTTP status, so connect_status stays 000 here.
curl --disable --silent --show-error --noproxy '' \
--connect-timeout 10 --max-time 20 \
--proxy 'socks5h://gw.portproof.org:7001' \
--proxy-user 'YOUR_FULL_PROXY_USERNAME' \
--output /dev/null \
--write-out 'curl_exit=%{exitcode} connect_status=%{http_connect}\n' \
'https://example.com/'Each probe is one GET with no retry. --disable comes first so curl skips its default configuration file, and the empty --noproxy list keeps proxy environment settings out of the check. Use a small HTTPS endpoint you are allowed to test; example.com is the reserved example domain. On Windows PowerShell, call curl.exe and adapt the line continuations.
The output is curl’s error line, from --show-error, and the summary line. Keep both. Do not add -v to a trace you plan to share: in our test run the verbose output printed the Proxy-Authorization header, which is your username and password in reversible Base64.
Read the exit code and the message together
These are the results of the two probes above against local test servers. The message is curl’s text, shortened.
| What happened | curl exit and message | Next check |
|---|---|---|
| Nothing listens on the port | 7 Failed to connect … Couldn't connect to server | Hostname and port, then your firewall or network. |
| The gateway name does not resolve | 5 Could not resolve proxy (with http://); 6 Could not resolve host, naming the gateway (with socks5h://) | Re-copy the hostname from the dashboard. |
| No answer to the connection attempt | 28 Failed to connect … Timeout was reached, or … Couldn't connect to server when the operating system gives up first | The network path or a firewall that drops packets. |
| The HTTP port accepts the connection but never answers CONNECT | 28 Proxy CONNECT aborted due to timeout | Retry once later. If it repeats, send the support report below. |
| The SOCKS5 port accepts the connection but never answers the greeting | 28 Connection timed out after … milliseconds | Retry once later. If it repeats, send the support report below. |
| An HTTP client on the SOCKS5 port | 56 Recv failure: Connection reset by peer | Use http:// with 7000. |
| A SOCKS5 client on the HTTP port | 28 Connection timed out, or 97 connection to proxy closed | Use socks5h:// with 7001. |
| Wrong SOCKS5 username or password | 97 User was rejected by the SOCKS5 server | Re-copy the complete username and the password. |
| Wrong HTTP proxy username or password | 56 CONNECT tunnel failed, response 407 (connect_status=407) | Follow the 407 guide. |
| The HTTP gateway cannot reach the destination | 56 CONNECT tunnel failed, response 502 (connect_status=502) | Follow the CONNECT tunnel guide. |
| The SOCKS5 gateway cannot reach the destination | 97 Can't complete SOCKS5 connection to … | Check the destination hostname. |
| The destination certificate is not trusted | 60 SSL certificate problem (connect_status=200) | Read the certificate section below. |
The CONNECT statuses in this table were chosen by the test server; on the live gateway, read the status curl prints. Other curl releases can attach a different number to the same failure: from curl 8.20.0, CONNECT tunnel failed, response … exits with 7 instead of 56. Match the message as well as the number, and treat 7 as a refusal only when the text says Couldn't connect to server.
Code 6 does not always mean your destination is wrong. With a SOCKS5 proxy URL it named the gateway. Through a working gateway, a destination that did not resolve came back as a 502 from the HTTP port or a 97 from the SOCKS5 port, never as 6.
Work through the causes in order
- Hostname: re-copy it from the dashboard rather than retyping it. Code 5, or code 6 naming the gateway, means the name did not resolve.
- Port and scheme together:
http://with 7000,socks5h://with 7001. A mismatch connects first and then fails with 56, 28 or 97, so it rarely looks like a refusal. Use the scheme the connection builder shows: withhttps://, curl starts TLS to the gateway itself, and against a plain HTTP proxy port our test server timed out (28) or failed the TLS handshake (35). - Your network: run the same probes from another network, such as a phone hotspot. If it works there, a firewall, egress rule or network policy on the first network is the difference, not your client.
- A gateway that accepted and went quiet: exit 28 after the connection opened, as in the two handshake rows above. Retry once after a pause; if it repeats, collect the support report rather than raising the timeout.
- Sticky sessions: if only a job with a session name fails, repeat the probe with a new session name in the username. If the new name works, the old session was the difference, not your host, port or password. A sticky session prefers an existing binding without reserving a device; the carrier may still change the IP. Why a sticky session changed IP covers the next checks.
Raise --connect-timeout only after this list. A longer wait cannot repair a closed port, a wrong name or a protocol mismatch. Once both probes pass, the curl testing guide checks the exit IP, latency and rotation.
The same split in Python Requests
Requests raises different exceptions for an HTTP gateway and a SOCKS5 gateway, so the order of the except branches matters. The example reads the username and password from the environment, as in the Requests guide, and the gateway from PROXY_SERVER. For SOCKS5, install the extra with python -m pip install "requests[socks]" and set PROXY_SERVER to socks5h://gw.portproof.org:7001.
import os
from urllib.parse import quote
import requests
server = os.environ.get("PROXY_SERVER", "http://gw.portproof.org:7000")
scheme, _, address = server.partition("://")
if scheme not in ("http", "socks5h") or not address or "@" in address:
raise SystemExit("Use http:// or socks5h:// with a host and port, no credentials")
user = quote(os.environ["PROXY_USER"], safe="")
password = quote(os.environ["PROXY_PASSWORD"], safe="")
proxy = f"{scheme}://{user}:{password}@{address}"
try:
response = requests.get(
"https://example.com/",
proxies={"http": proxy, "https": proxy},
timeout=(3.05, 27),
)
print("HTTP", response.status_code)
except requests.exceptions.ConnectTimeout:
print("No answer from the proxy within the connect timeout")
except requests.exceptions.ProxyError as error:
print("The HTTP proxy failed:", error)
except requests.exceptions.ConnectionError as error:
print("Connection failed:", error)
except requests.exceptions.Timeout:
print("Connected, but no answer within the read timeout")| Failure | HTTP gateway | SOCKS5 gateway (socks5h) |
|---|---|---|
| Port refused | ProxyError | ConnectionError |
| Gateway name does not resolve | ProxyError | ConnectionError |
| Wrong username or password | ProxyError, with 407 in the message | ConnectionError, SOCKS5 authentication failed |
| No answer to the connection attempt | ProxyError, with the connect timeout in the message | ConnectTimeout |
| Connection accepted, handshake never answered | ReadTimeout, caught by the Timeout branch | ConnectTimeout |
So ConnectTimeout alone misses an HTTP gateway that never accepts the connection: urllib3 wraps that timeout in ProxyError. The last branch catches an HTTP gateway that accepted the connection but never answered CONNECT; without it, the script stopped with a traceback. In that case the wait was limited by the connect value, 3.05 seconds, not the read value. The printed messages contained no password in our runs.
Requests also reads HTTPS_PROXY and HTTP_PROXY when you pass no proxies. If curl works and your script does not, compare the two processes with the environment-settings guide.
Certificate errors belong to another layer
An HTTP gateway relays CONNECT and does not terminate TLS: your client checks the destination’s certificate through the tunnel. In our test without the right CA bundle, the HTTP probe ended with connect_status=200 and exit 60, SSL certificate problem: unable to get local issuer certificate. Requests reported the same failure as SSLError with CERTIFICATE_VERIFY_FAILED.
A 200 there means the gateway did its part. Check the destination hostname, your system clock, your CA bundle, and whether a corporate or public network intercepts TLS with its own certificate. Keep verification on: switching it off hides exactly the interception you are trying to find, and it repairs none of the failures above.
What to send support
If the checklist does not settle it, send the measured result rather than a description. Leave out the password, the full username and any -v trace.
Checked at (UTC):
curl version:
Proxy scheme, hostname and port (no credentials):
Destination hostname and port:
curl error line (exact text):
curl_exit:
connect_status:
Same result from another network: yes / no / not checked
Session name, if the username has one:What we checked locally
On 1 October 2026 we ran both probes and the Python example, as printed, against local test servers: an HTTP proxy with CONNECT and Basic authentication, a SOCKS5 server with username and password, variants that accept a connection and never answer, a closed port, a port that never completes a connection, and an HTTPS origin signed by a local test CA. Credentials were synthetic and certificate verification stayed on; the only additions were the test addresses and that CA bundle.
Versions: curl 8.7.1 on macOS, Python 3.12.14, requests 2.34.2, urllib3 2.8.0 and PySocks 1.7.1. On that machine the operating system abandoned an unanswered connection after about 7.8 seconds, which is why a 10-second limit could end with Couldn't connect to server while still exiting 28. These checks do not measure the live gateway, its timing or the statuses it sends.
What is not allowed
Run these checks only against endpoints you are permitted to test, and follow the acceptable-use policy.
Read next
Fix ERR_PROXY_CONNECTION_FAILED in Chrome
Separate a Chrome proxy connection or required PAC failure from authentication, a refused CONNECT tunnel and a certificate error.
Read the guide
Fix CONNECT tunnel failed: 403, 407, 502, 503
Read the proxy and destination statuses separately, then choose the next check for 403, 407, 502 or 503.
Read the guide
More in Connect and debug
- ERR_TUNNEL_CONNECTION_FAILED in Chrome and Edge
- Docker proxy: pull, build and container settings
- Proxy format: URL, list formats and ports
- Git proxy: git config http.proxy and checks
- HTTP 429: rate limits and careful retries
- Fix proxy certificate errors in curl
Show 25 more
- pip proxy setup and connection checks
- npm CLI proxy setup and connection checks
- PHP cURL proxy setup and authentication
- Python urllib proxy setup and authentication
- Firefox proxy settings and authentication
- PowerShell proxy setup and authentication
- Puppeteer proxy setup and authentication
- The proxy requires a username and password
- Proxy settings: what they mean and how to check
- Proxy errors: causes and fixes for each message
- Chrome proxy extension: FoxyProxy, ZeroOmega
- Wget proxy setup and authentication
- Postman proxy server setup and authentication
- Axios proxy setup for Node.js
- Go HTTP proxy setup with authentication
- Scrapy proxy setup with authentication
- aiohttp proxy setup with authentication
- HTTPX proxy setup for sync and async
- Python Requests proxy setup
- Playwright proxy setup and authentication
- Node.js fetch proxy setup with Undici
- HTTP 407 Proxy Authentication Required: fixes
- curl proxy: test and use a proxy with curl
- SOCKS5 vs HTTP proxy: which to use
- HTTPS_PROXY not working? Check your client
Buy mobile and residential proxy GB
Choose your GB or reserve a mobile device.