Docs menu
Docs · Error guide

Proxy Connection Refused

"Proxy connection refused" means your app reached the proxy's address, but nothing accepted a connection on the port it tried: the host or port is wrong, a local proxy app isn't running, or a firewall rejects the connection. In SOCKS5 the same words have a second meaning: the proxy answered with reply code 0x05, "Connection refused", because the target site refused the proxy's connection, while 0x02 means the proxy's own rules forbid that target (RFC 1928, section 6). A connection that opens and then keeps dropping is a third fault, usually an idle timeout or a reused dead connection. ProxyField's gateway takes HTTP, HTTPS and SOCKS5 on gate.proxyfield.io:7000, and you can test it on your own setup with the Easy Trial: 1 GB for $2.95.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
gate.proxyfield.io:7000
SOCKS5 failures on ProxyField
SOCKS5 0x04 on ProxyFieldProxyField value
Gatewaygate.proxyfield.io:7000 for HTTP, HTTPS and SOCKS5, with the same username and password
Wrong login or passworda SOCKS5 authentication failure (on HTTP and HTTPS: 407 Proxy Authentication Required)
No traffic leftalso an authentication failure (on HTTP and HTTPS: 402 Payment Required)
Exit could not be connectedreply 0x04 (on HTTP and HTTPS: 502 Bad Gateway, "ProxyField: temporary error. Try again in a few seconds.")
Traffic runs out mid-connectionthe connection closes
Costa connection the gateway refuses (407, 402, 502) costs nothing
Username<login>-country-us-city-new_york: names in lowercase with underscores for spaces
Passwordyour ProxyField password
Proxy URLsocks5h://gate.proxyfield.io:7000, so the gateway resolves the site's name
AllowlistSOCKS5 works with it: up to 100 IPv4 addresses, on the port you set up in the dashboard
Refused before any replythe connection never reached the SOCKS5 handshake: check the host, the port and your firewall

What to change

  1. Check the host gate.proxyfield.io and the port 7000 (with the allowlist, the port you set up in the dashboard).
  2. On an authentication failure, copy the login and password again and check the remaining traffic in your dashboard.
  3. On reply 0x04, try again in a few seconds, check the city name against your dashboard list, or widen it to the region or country.
  4. Set the tool's proxy type to SOCKS5 explicitly, with the username and password.
  5. Run one request over SOCKS5 with -v and read where it stops.

The SOCKS5 test, with socks5h so the gateway resolves the site's name:

Shell
curl -v -x socks5h://gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org

SOCKS5 reply codes in general, 0x04 included: RFC 1928: SOCKS Protocol Version 5 (RFC Editor).

On this page 7 sections

Which side failed: read the timing and the code

What you seeWhich side failedFix
Refused at once, before any SOCKS or HTTP replyYour machine to the proxy: host, port, a local proxy app, a firewallSteps 1–4 below
No reply for several seconds, then a timeoutNothing answered: wrong host, or a network that drops the trafficStep 4, then 502 and 504 timeouts
SOCKS5 method X'FF' ("No authentication method was acceptable.")The proxy accepts none of the login methods your client offeredGive the client a username and password, or use the allowlist
SOCKS5 login failure ("User was rejected by the SOCKS5 server")Your credentialsCheck the login and password
SOCKS5 reply 0x02The proxy's rules forbid this target or portCheck the target and the provider's policy
SOCKS5 reply 0x05The target refused the proxy's connectionCheck the target's host and port; try it without the proxy
HTTP 407Your credentials, on an HTTP proxy407 Proxy Authentication Required
Opened, then reset, "end of file" or "socket hang up"The connection was cut mid-requestWhy your proxy connection keeps dropping

What "connection refused" means

Connection refused happens before any HTTP status code. Your client asks to open a TCP connection, and the other side answers at once with a reset: the machine is there, but no service accepts connections on that port, or a firewall rule rejects them. Each tool words it differently:

Where you see itWhat it says
cURLExit code 7, "Failed to connect to … port 7000" (libcurl error codes: CURLE_COULDNT_CONNECT, "Failed to connect() to host or proxy")
Python requestsProxyError: … Unable to connect to proxy … Connection refused, with [Errno 111] on Linux, [Errno 61] on macOS or [WinError 10061] on Windows
Node.jsconnect ECONNREFUSED <ip>:<port>
Chrome and EdgeERR_PROXY_CONNECTION_FAILED, or ERR_SOCKS_CONNECTION_FAILED for a SOCKS proxy
FirefoxAn error page titled "The proxy server is refusing connections" (the text below the title varies by version)

Chromium's list of network errors defines PROXY_CONNECTION_FAILED as a failure to resolve the proxy's name or to connect a socket to it, not a failure of the website behind it.

Refused, timed out or dropped?

Three failures look alike in a log, and each has its own cause:

SymptomWhat happenedUsual cause
Refused, instantlyThe host answered and rejected the connection on that portWrong port, a local proxy app that isn't running, a firewall rule that rejects
Timed out after several secondsNothing answered at allWrong host, a network or firewall that silently drops the traffic
Opened, then dropped ("connection reset", "end of file", "socket hang up")The connection worked and was closed mid-requestIdle timeouts, an unstable network, the target closing the connection, a reused dead connection

A timeout has its own guide: 502 Bad Gateway and 504 Gateway Timeout. A message that says the app "cannot establish" a proxy connection is the general form of this error: cannot establish proxy connection.

How to fix a refused proxy connection

Check these in order; most refused connections end at step 1 or 2.

  1. Host and port. Compare them with your account, character by character. For ProxyField the host is gate.proxyfield.io and the port is 7000 for HTTP, HTTPS and SOCKS5 alike with a username and password (with the IP allowlist, the port you set up in the dashboard); a host field takes the name only, with no http:// and no spaces. The proxy format guide shows where each part goes.

  2. A proxy you forgot. If the error names 127.0.0.1 or localhost, your system or browser points to a local proxy app (a debugging proxy, a VPN client, a filter) that is closed or uninstalled. Turn that setting off (how to turn off a proxy), or find the extension that set it (proxy controlled by an extension).

  3. The port itself. Test the TCP connection with no proxy software in between:

    # macOS and Linux
    nc -vz gate.proxyfield.io 7000
    # Windows PowerShell
    Test-NetConnection gate.proxyfield.io -Port 7000

    "succeeded" or TcpTestSucceeded : True means the port is reachable from this machine, so the problem is the app's settings. "Connection refused" or False means something on the way rejects the port.

  4. Firewall, antivirus and the network. Allow the app to make outbound connections to port 7000, or the port you set up in the dashboard for the allowlist. Office, school and public networks often block ports other than 80 and 443: test once from another network, such as a phone hotspot.

  5. The proxy end to end. One cURL request with your credentials:

    Shell
    curl -v -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org

    The same test over SOCKS5 (socks5h lets the proxy resolve the site's name):

    Shell
    curl -v --proxy socks5h://gate.proxyfield.io:7000 --proxy-user "<login>-country-us:<password>" https://api.ipify.org

    An IP address back means the proxy works from this machine over that protocol. You can also run the endpoint through the proxy checker, which takes up to 100 proxies per check and stores no requests; each check uses a small amount of proxy traffic.

  6. The account. On HTTP proxies in general, a wrong password comes back after the connection opens, as an HTTP 407 status, not as a refused connection (407 Proxy Authentication Required); on SOCKS5 it ends the handshake (next section). In your ProxyField account, the dashboard shows real-time usage and remaining gigabytes, and access opens once the payment is confirmed.

The same check in Python separates the three cases (refused, timed out, name not found) before you debug your scraper:

Python
import socket

HOST, PORT = "gate.proxyfield.io", 7000
try:
    socket.create_connection((HOST, PORT), timeout=10).close()
    print("TCP connection to the proxy port works")
except ConnectionRefusedError:
    print("refused: wrong port, or a firewall rejects the connection")
except socket.timeout:
    print("timed out: the host is wrong, or the network drops the traffic")
except socket.gaierror:
    print("the proxy host name does not resolve")

A host name that does not resolve is a DNS problem, not a refusal: see unknown proxy server and proxy DNS errors.

SOCKS5 errors: "rejected connection", "general failure" and "end of file"

A SOCKS5 error that comes as a reply code means the opposite of a refused connection to the proxy: your client reached the SOCKS5 proxy, and the proxy reports what happened on its side. The codes are fixed by RFC 1928, section 6:

CodeMeaningWhat to check
0x01General SOCKS server failureA catch-all: retry, then test the same target over HTTP
0x02Connection not allowed by rulesetThe proxy's rules forbid this target or port
0x03Network unreachableThe proxy can't route to the target's network
0x04Host unreachableThe target is down, or its name doesn't resolve on the proxy side
0x05Connection refusedThe target refused the proxy's connection: wrong port on the target, or the site is down
0x06TTL expiredThe connection to the target took too long
0x07Command not supportedThe client asked for a command the proxy doesn't offer
0x08Address type not supportedThe client sent an address form the proxy doesn't accept

Codes X'09' to X'FF' are unassigned. An app that shows "SOCKS5 proxy rejected connection" is reporting a reply code such as 0x02 or 0x05; check the app's log for the code. cURL prints it in brackets: cannot complete SOCKS5 connection to example.com. (5) means reply 0x05, and the run ends with exit code 97, CURLE_PROXY, "Proxy handshake error" (libcurl error codes).

Before any reply code: the login handshake

A SOCKS5 connection starts with method negotiation (RFC 1928, section 3). The client lists the login methods it supports: X'00' no authentication, X'02' username/password. The proxy picks one, or answers X'FF', "no acceptable methods", and the client must close the connection. With username/password (RFC 1929), a STATUS other than X'00' is a failure, and the server must close the connection. So a login problem on SOCKS5 looks like a closed or refused connection, not like an HTTP error page:

cURL saysMeaningFix
No authentication method was acceptable.The proxy answered X'FF': it wants a login your client didn't offerPass --proxy-user "<login>:<password>", or add your IP to the allowlist
User was rejected by the SOCKS5 server (1 1).The username/password exchange failedCheck the login and password, character by character
cannot complete SOCKS5 connection to <host>. (<code>)The login worked; the CONNECT request got reply code <code>Read the code in the table above

On ProxyField, some site categories are restricted to protect the network, including financial and government services.

"End of file" (EOF) means the proxy closed the connection before it sent a full reply. The usual causes are a protocol mismatch (an HTTP client talking to a SOCKS5 port, or a SOCKS5 client talking to an HTTP port), a login the proxy didn't accept, or a connection cut on the way. Set the proxy type explicitly instead of "auto", check the credentials, and use socks5h:// in cURL and Python so the proxy resolves the target's name (Python requests needs pip install requests[socks] for SOCKS proxy URLs). Setup details: SOCKS5 proxies.

Why your proxy connection keeps dropping

A dropped connection opened fine and closed before the response finished. Check the likely causes in this order:

  • Idle connections. Routers, firewalls, proxies and websites close connections that sit idle. An HTTP client that keeps a pool of open connections can pick one that has already been closed, and the request fails with a reset or "end of file". Retry on connection errors; most HTTP clients can do it for you (code below).
  • Long sessions. A sticky session holds one IP for the time you set with ttl, from 30 s to 36 h (20 minutes if you set none), and an IP idle for 120 s is replaced. The IP is not guaranteed if its exit node drops: on a connection error the gateway retries once with a new session, so the IP may change, and a connection that breaks is not restored. Keep long jobs inside the session time and let your client reconnect and retry every step; if a session ends well before its time, send the 24/7 live chat the time and your session details.
  • Your own network. Weak Wi-Fi, a laptop going to sleep, or a VPN running under the proxy can all cut connections. Test from a wired connection with the VPN off.
  • The target closes the connection. Some sites reset connections from clients they rate-limit or flag; slow down and see the 429 Too Many Requests guide.
  • Your machine runs out of connections. A scraper that opens thousands of connections can hit the operating system's limit on open files or ports, and new connections fail or reset. ProxyField allows unlimited concurrent threads, but your machine and the target still have limits: cap concurrency and reuse connections.

On the ProxyField side, "If a node slows down, traffic automatically moves to the next one." This Python requests setup retries connection errors with back-off and sets separate connect and read timeouts:

Python
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry

proxy = "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000"
retry = Retry(total=4, connect=3, read=2, backoff_factor=1,
              status_forcelist=[502, 503, 504], allowed_methods=["GET", "HEAD"])

session = requests.Session()
session.proxies = {"http": proxy, "https": proxy}
session.mount("http://", HTTPAdapter(max_retries=retry))
session.mount("https://", HTTPAdapter(max_retries=retry))

r = session.get("https://api.ipify.org", timeout=(10, 30))  # (connect, read) in seconds
print(r.status_code, r.text)

More Python setups: proxies in Python.

Still refused? What to send support

If the port test and cURL fail from two different networks with the right host, port and login, contact our 24/7 live chat with:

  • the time and time zone of the failure;
  • the exact error text and the tool (cURL, Python, browser, app);
  • the result of nc -vz gate.proxyfield.io 7000 or Test-NetConnection;
  • your public IP, if you use the allowlist.

In three account cases the ProxyField gateway answers over HTTP and HTTPS: 407 Proxy Authentication Required for an IP that is not on the allowlist, 402 Payment Required with the text ProxyField: no traffic left. Top up at https://proxyfield.io for an account with no traffic left, and no response of its own for a restricted target category. Over SOCKS5, a failed login or no traffic left ends in an authentication failure, and an exit that could not be connected gets reply 0x04.

For a proxy that fails in other ways, use the full checklist in why is my proxy not working.

Proxy Connection Refused FAQ

What does "proxy connection refused" mean?

ProxyField's gateway takes HTTP, HTTPS and SOCKS5 at gate.proxyfield.io:7000, and you can test your setup with the Easy Trial, 1 GB for $2.95; "proxy connection refused" means your client reached a host, but nothing accepted the connection on the port it tried. The usual causes are a wrong host or port, a local proxy app that isn't running, or a firewall rule that rejects the connection.

Why does my proxy connection keep dropping?

A connection that opens and then drops is usually closed by an idle timeout, an unstable network or the target site. Retry on connection errors with back-off, keep multi-step jobs inside a sticky session of 30 s to 36 h, and test once from a wired network with the VPN off. If drops go on, send the 24/7 live chat the time and your session details.

Why does Firefox say "The proxy server is refusing connections"?

Firefox shows it when the proxy set in its connection settings rejects the connection. Open Settings, then Network Settings, and check the proxy host and port, or choose "No proxy" if you didn't mean to use one.

Why does my browser say the proxy server refused the connection when I never set up a proxy?

An app, a VPN client or an extension set a system or browser proxy and then closed or was uninstalled, so the setting points to a proxy that no longer runs, often on 127.0.0.1. Turn the proxy setting off, or remove the extension that controls it.

What does a SOCKS5 proxy "rejected connection" or "connection refused" error mean, and how do I fix it?

It means one of two things: your client couldn't open a connection to the proxy at all (wrong host or port, a firewall), or the proxy answered with reply code 0x05 (the target refused it) or 0x02 (the proxy's rules forbid the target), as RFC 1928 defines them. Test the port with nc -vz <host> <port>, then run curl -v --proxy socks5h://<host>:<port> --proxy-user "<login>:<password>" https://api.ipify.org and read the code cURL prints. A refusal before any reply is your network or settings; a code is the proxy's report about the target.

What does "No authentication method was acceptable" mean on a SOCKS5 proxy?

The proxy answered method X'FF' in the SOCKS5 handshake: none of the login methods your client offered is one it accepts, so the connection is closed. Usually the client sent no username and password to a proxy that requires them; add them, or put your IP on the proxy's allowlist.

What is a "general SOCKS server failure"?

It is SOCKS5 reply code 0x01, a catch-all for a failure on the proxy's side that has no more specific code. Retry, then test the same target through the HTTP proxy to see whether the problem is the target or the SOCKS5 setup.

What does "SOCKS5 proxy error: end of file" mean?

The proxy closed the connection before it sent a full reply. Check that the app's proxy type matches the port (SOCKS5, not HTTP), that the login is correct, and that nothing on your network cuts the connection.

What does "[Errno 111] Connection refused" mean when I use a proxy in Python?

Python couldn't open a TCP connection to the proxy's host and port; [Errno 61] on macOS and [WinError 10061] on Windows mean the same. Check the host and port in your proxy URL, then test the port with nc -vz or Test-NetConnection.

Why does my proxy connection drop after a period of inactivity?

Routers, firewalls, proxies and websites close connections that sit idle, and a client that later reuses one gets a reset or "end of file". Let your HTTP client retry on connection errors, and send keep-alive traffic on connections that must stay open.

Show 2 more questionsShow fewer questions

Can a proxy connection fail even when the proxy itself is working?

Yes. A local firewall, a forgotten system proxy, a wrong port in one app, or a target that refuses the proxy's connection can all fail while the proxy serves other clients normally. Test the proxy with one cURL request from the same machine to tell which side fails.

Is "connection refused" the same as a connection timeout?

No. A refused connection is rejected at once by the host, usually because of a wrong port or a rejecting firewall, while a timeout means nothing answered at all, usually because of a wrong host or a network that drops the traffic.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.