SOCKS5 Connection Refused: Who Refused the Connection
The text “connection refused” appears in two quite different situations: the site the proxy was connecting to refused, or the connection to the proxy itself failed.
Updated · Prokso editorial team
- Connection refused means either the site refused or the connection to the proxy itself failed
- Often the site refuses connections on this port or the port is closed to the proxy
- Read the error text: is it about the site or about the proxy host and port
What the error means
In the SOCKS5 protocol (RFC 1928), the reply code X'05' means “Connection refused”: the proxy tried to connect to the site, and the site refused. Next to it in the standard are X'02', connection not allowed by the server's ruleset, and X'03' and X'04', network or host unreachable.
Another situation is when the program could not connect to the proxy itself. Then SOCKS5 does not start at all, and the operating system reports “Connection refused”: nothing accepts connections on this host and port.
Telling them apart is simple: if the error mentions SOCKS or code 5, the site refused. If the error is about the proxy host and port, for example gw.prokso.com:824, the problem is in the connection to the proxy.
Causes
- The site does not accept connections on this port. The service on the site is down or the port is specified incorrectly.
- The site's port is closed for the proxy. Mail ports are closed; open ones are 80, 443, 53, 853, 5228, 5060, 8080, 8090, 8443, 8888.
- The wrong proxy port. SOCKS5 works on port 824 and on sticky IP ports 10000-20000.
- An error in the proxy host name. A typo in gw.prokso.com or an extra space.
- The program does not offer username and password sign-in. If your IP is not on the IP whitelist, the proxy will not accept the connection without a username and password. Under RFC 1928, the server then replies X'FF': no acceptable authentication method.
How to fix it
- Read the error text: is it about the site or about the proxy host and port?
- If the site refused, check the site's address and port and open it without the proxy.
- If the connection to the proxy failed, copy the line from the dashboard again and check the port: 824 or 10000-20000 for SOCKS5.
- Make sure the program passes the username and password, or turn on access by IP (IP whitelist) and add your address.
- Check whether your firewall or antivirus blocks outgoing connections: try a different network.
How to check that it works
Paste the line into the proxy checker. If it connects, the connection to the proxy is fine, and the refusal comes from the specific site.
Setup guides where this error comes up
FAQ
What does X'02' connection not allowed by ruleset mean?
The server refused under its own rules. For Prokso, this is how a request to a site or port closed to all customers may look, see <a href="/en/blocked-sites">Blocked websites</a>.
How is this different from ECONNREFUSED in Node.js?
ECONNREFUSED is the same refusal at the operating system level, but for a connection your program opened. See <a href="/en/errors/econnreset-econnrefused">ECONNRESET and ECONNREFUSED</a>.
Is traffic charged if the connection was not established?
Only what actually passed through the proxy is charged. If the connection to the site did not happen, that is just a few bytes of service exchange.
Other proxy errors
Residential $1.59, mobile $2.50, datacenter $0.65 per GB
Sign up in a minute, get access right after payment.