We use Google Analytics and PostHog to see which pages bring in customers and where visitors get stuck. Until you agree both run without cookies — they count the pages you open and what you click, but cannot recognise you across visits. Agreeing lets them use cookies, so we can tell repeat visitors apart, lets PostHog record a replay of your visit, with anything you type hidden, and loads OpenAI’s measurement pixel, which shows us whether a visit came from one of our ads in ChatGPT. Nothing is sent to OpenAI until you agree. Either way we never build advertising profiles or target ads. Privacy Policy

15% off your first purchase with code WELCOME15, up to 25 GB.

See pricing

Guide · Proxy basics

SOCKS5 proxy errors: curl (97), "General SOCKS server failure" and reply codes 1 to 8

A SOCKS5 connection fails at one of three steps, and the error tells you which. At the greeting the proxy refuses your authentication method (No authentication method was acceptable). At login it rejects the username or password (User was rejected by the SOCKS5 server (1 1)). At the connect step it answers with a reply code from RFC 1928 that says why it could not reach the website: curl prints the code in parentheses, as in curl: (97) Can't complete SOCKS5 connection to example.com. (1), and Python and Node print its name, such as General SOCKS server failure. Exit code 97 is curl's general proxy handshake error. Codes 1 and 6 are failures at the proxy or timeouts and are worth one retry; 2, 4 and 5 point at the target host or port; 7 and 8 at what your client asked for.

Reviewed 14 Nov 2026

The short answer

  • curl 8.7.1 reports every SOCKS5 failure as exit 97 (CURLE_PROXY). The number in parentheses at the end of Can't complete SOCKS5 connection is the proxy's RFC 1928 reply code.
  • "General SOCKS server failure" is reply code 1. RFC 1928 gives it no further meaning, so it only says the proxy could not complete the request.
  • With socks5h:// the proxy resolves the hostname, so a misspelled host comes back as reply 4, Host unreachable. With socks5:// in curl and requests the same typo fails on your own machine.
  • httpx and aiohttp-socks send the hostname to the proxy even for socks5://. aiohttp-socks rejects the socks5h:// scheme with ValueError: Invalid scheme component: socks5h.
  • requests raises ConnectionError, not ProxyError, for SOCKS failures, so an except ProxyError written for HTTP proxies does not catch them.

Which step failed: errors by handshake stage

RFC 1928 defines the order: the client lists the authentication methods it supports, the server picks one (or answers X'FF', no acceptable methods), RFC 1929 username/password login runs if it was chosen, then the client sends its CONNECT request and the server answers with a reply code. Reproduced on 2026-11-14 with curl 8.7.1 against local SOCKS5 test servers:

curl 8.7.1 outputStageWhat it means
curl: (97) No authentication method was acceptable.GreetingThe proxy requires a username and password and none were sent, so it answered X'FF'
curl: (97) User was rejected by the SOCKS5 server (1 1).LoginWrong username or password. The two numbers are the version and status bytes of the RFC 1929 reply; any non-zero status is a failure
curl: (97) Can't complete SOCKS5 connection to example.com. (1)ConnectThe proxy could not reach the target; the last number is the reply code (next table)
curl: (97) Received invalid version in initial SOCKS5 response.GreetingThe port is not a SOCKS5 server. Ours was an HTTP proxy answering 400
curl: (97) connection to proxy closedGreetingThe server closed the connection without answering
curl: (97) Could not resolve host: no-such-host.invalidBefore connectsocks5:// resolves the target on your machine, and that failed; with socks5h:// it would be reply 4
curl: (7) Failed to connect to 127.0.0.1 port 28099 after 0 ms: Couldn't connect to serverBefore SOCKSNothing listening on that host and port
curl: (6) Could not resolve host: no-such-proxy.invalidBefore SOCKSThe proxy's own hostname does not resolve. For HTTP proxies curl uses exit 5 here, for SOCKS proxies exit 6

SOCKS5 reply codes 1 to 8 and what to do

The reply code is the second byte of the server's answer to CONNECT; 0 means success. Our test server sent each code on request, and curl printed curl: (97) Can't complete SOCKS5 connection to example.com. (N) for every one. The middle column is what requests 2.34.2 with PySocks 1.7.1 printed.

CodeRFC 1928 namePySocks / requests printsWhat to check
1general SOCKS server failure0x01: General SOCKS server failureA failure inside the proxy with no detail. Retry once on a new connection; if it repeats, test the same target through the HTTP form of the proxy
2connection not allowed by ruleset0x02: Connection not allowed by rulesetThe proxy's rules block this destination or port. Retrying will not help
3Network unreachable0x03: Network unreachableThe proxy has no route to the target's network. Check the target address
4Host unreachable0x04: Host unreachableThe proxy could not reach the host. Our test server answered 4 when the hostname did not resolve, so check the spelling first
5Connection refused0x05: Connection refusedThe target host refused that port. Check the port in the URL
6TTL expired0x06: TTL expiredRFC 1928 gives only the name. Treat it as transient: retry once, later
7Command not supported0x07: Command not supported, or protocol errorThe proxy does not support the command the client sent (CONNECT, BIND or UDP ASSOCIATE). Check the client library's settings
8Address type not supported0x08: Address type not supportedThe proxy refuses the address type you sent: IPv4, domain name or IPv6. Switching between socks5:// and socks5h:// changes it

libcurl exposes the names as CURLINFO_PROXY_ERROR, for example CURLPX_REPLY_GENERAL_SERVER_FAILURE for 1, but the curl 8.7.1 command line has no write-out variable for it: -w '%{proxy_error}' printed unknown --write-out variable. Read the number in parentheses instead.

General SOCKS server failure in each client

The same reply code 1 and the same wrong password, reproduced in six clients on 2026-11-14. Search this table for your client's wording.

Client (version run)Reply 1 (general failure)Wrong password
curl 8.7.1curl: (97) Can't complete SOCKS5 connection to example.com. (1)curl: (97) User was rejected by the SOCKS5 server (1 1).
Python requests 2.34.2 + PySocks 1.7.1requests.exceptions.ConnectionError: SOCKSHTTPSConnectionPool(...): Max retries exceeded ... Failed to establish a new connection: 0x01: General SOCKS server failure... Failed to establish a new connection: SOCKS5 authentication failed
httpx 0.28.1 (socksio 1.0.0)httpx.ProxyError: Proxy Server could not connect: General SOCKS server failure.httpx.ProxyError: Invalid username/password
aiohttp 3.14.5 + aiohttp-socks 0.12.0ProxyError: General SOCKS server failureProxyError: Username and password authentication failure
Node socks-proxy-agent 10.1.0 (socks 2.8.10), with https.get or axiosError: Socks5 proxy rejected connection - FailureError: Socks5 Authentication failed
Chrome 157 and Chromium 156net::ERR_SOCKS_CONNECTION_FAILED, also for codes 4 and 5Chrome has no SOCKS5 login, see ERR_NO_SUPPORTED_PROXIES

With no credentials sent to a proxy that needs them, the wording changes again: PySocks says All offered SOCKS5 authentication methods were rejected, httpx Requested NO AUTHENTICATION REQUIRED from proxy server, but got NO ACCEPTABLE METHODS., aiohttp-socks No acceptable authentication methods were offered and the Node socks package Received invalid Socks5 initial handshake (no accepted authentication type).

A port that answers in HTTP instead of SOCKS5 shows up as SOCKS5 proxy server sent invalid data (PySocks), socksio.exceptions.ProtocolError: Malformed reply (httpx), Unexpected SOCKS version number: 72 (aiohttp-socks; 72 is the H of HTTP/1.1) and Received invalid Socks5 initial handshake (invalid socks version) (Node).

socks5 vs socks5h: where the hostname is resolved

Requests documents that socks5:// resolves DNS on the client and socks5h:// on the proxy, in line with curl. Not every client follows that rule. Our SOCKS server logged the address type (ATYP) of each CONNECT for https://example.com/:

Client`socks5://` sends`socks5h://` sends
curl 8.7.1An address resolved locally (ATYP 4, IPv6 here)The hostname (ATYP 3)
requests 2.34.2 + PySocks 1.7.1An address resolved locally (ATYP 4)The hostname (ATYP 3)
httpx 0.28.1The hostname (ATYP 3)The hostname (ATYP 3)
aiohttp-socks 0.12.0The hostname (ATYP 3); its rdns option is on by defaultRejected: ValueError: Invalid scheme component: socks5h
Chrome 157 (--proxy-server)The hostname (ATYP 3)Rejected: net::ERR_NO_SUPPORTED_PROXIES

Why it matters for errors: with local resolution a misspelled hostname fails on your machine (curl: (97) Could not resolve host: no-such-host.invalid; in requests on macOS [Errno 8] nodename nor servname provided, or not known), while with proxy-side resolution the proxy reports it as reply 4. Proxy-side resolution also keeps DNS lookups off your own network, see socks5h and DNS leak.

Fix checklist

  • Read the stage first. Greeting and login errors are configuration on your side; reply codes describe the proxy's attempt to reach the target.
  • Credentials: a wrong password and a missing one give different errors (tables above). In curl, URL-encode them inside the proxy URL or pass them with -U user:pass, which worked for SOCKS5 in our test.
  • Scheme and port: an "invalid version" or "invalid data" error means the port answered in another protocol. Check that the scheme in the URL matches what that port serves. ARC's gateway serves HTTP and SOCKS5 on the same port with the same credentials, so there the scheme decides.
  • Reply 1 or 6: retry once on a new connection, then stop. Reply 2, 4 or 5: fix the hostname, port or destination; a retry gets the same answer.
  • Browsers: Chrome reports reply codes only as ERR_SOCKS_CONNECTION_FAILED and cannot log in to SOCKS5, so use the HTTP form of the proxy there.
  • Then test the same string in the proxy tester, which accepts socks5:// and socks5h:// and names the failing step.

Code

Worked example

Check a SOCKS5 proxy with curl and read the result
curl -sS -o /dev/null -w '%{http_code}\n' \  -x "socks5h://USERNAME_pool-arcfast_country-de:PASSWORD@proxy.arcproxies.io:8000" https://example.com/# Reproduced locally on 2026-11-14, curl 8.7.1:# working              -> 200# wrong password       -> curl: (97) User was rejected by the SOCKS5 server (1 1).# no credentials       -> curl: (97) No authentication method was acceptable.# proxy-side failure   -> curl: (97) Can't complete SOCKS5 connection to example.com. (1)# not a SOCKS5 port    -> curl: (97) Received invalid version in initial SOCKS5 response.
requests: read the reply code out of the exception (ran with PySocks 1.7.1)
import reimport requestsPROXY = "socks5h://USERNAME_pool-arcfast_country-de:PASSWORD@proxy.arcproxies.io:8000"   # pip install "requests[socks]"def socks_reply_code(err: Exception) -> int | None:    """PySocks writes the RFC 1928 reply code first: '0x01: General SOCKS server failure'."""    m = re.search(r"0x0([1-8]): ", str(err))    return int(m.group(1)) if m else Nonetry:    r = requests.get("https://example.com/", proxies={"http": PROXY, "https": PROXY}, timeout=30)    print(r.status_code)except requests.exceptions.ConnectionError as err:   # SOCKS failures are not ProxyError    code = socks_reply_code(err)    if code in (1, 6):        print(f"reply {code}: failure at the proxy or a timeout; retry once, then stop")    elif code is not None:        print(f"reply {code}: check the target host and port; retrying will not help")    else:        print("handshake or authentication failed:", err)
Node: socks-proxy-agent with axios (ran with socks 2.8.10)
import axios from 'axios';import { SocksProxyAgent } from 'socks-proxy-agent';const agent = new SocksProxyAgent('socks5h://USERNAME_pool-arcfast_country-de:PASSWORD@proxy.arcproxies.io:8000');try {  const res = await axios.get('https://example.com/', {    httpAgent: agent, httpsAgent: agent, proxy: false, timeout: 30_000,  });  console.log(res.status);} catch (err) {  // "Socks5 proxy rejected connection - Failure" is reply 1, "Socks5 Authentication failed" a wrong password  console.error(err.message);}

FAQ

Questions

Something not covered? Write to contact@arcproxies.io.

What does curl: (97) Can't complete SOCKS5 connection mean?

The SOCKS5 proxy accepted your login but could not connect to the target. The number in parentheses at the end is the RFC 1928 reply code: 1 general failure, 2 not allowed by ruleset, 3 network unreachable, 4 host unreachable, 5 connection refused, 6 TTL expired, 7 command not supported, 8 address type not supported.

What is a General SOCKS server failure?

Reply code 1 in RFC 1928. The proxy reports that it could not complete the request without saying why. Retry once on a new connection; if it repeats, check the target host and port and test the same target through the HTTP form of the proxy.

What does SOCKS5 Host unreachable (reply 4) mean?

The proxy could not reach the target host. With socks5h:// the proxy also resolves the hostname, so a misspelled or non-existent hostname comes back as reply 4. Check the hostname before retrying.

Why does curl say No authentication method was acceptable?

The SOCKS5 proxy requires a username and password, and curl offered no login method because none was given. Add the credentials to the proxy URL or pass them with -U.

What does User was rejected by the SOCKS5 server (1 1) mean?

The proxy rejected the username or password. The numbers are the version and status bytes of the RFC 1929 login reply; any status other than 0 means failure. Copy the credentials again and URL-encode special characters.

Should I use socks5:// or socks5h://?

Use socks5h:// in curl and Python requests so the proxy resolves hostnames. httpx and aiohttp-socks already send the hostname with socks5://, and aiohttp-socks and Chrome reject the socks5h:// scheme.

Next

Where to go from here

Use caseProxies for web scraping and data collectionA second provider that just works — Scrapy, requests, Crawlee or Playwright, self-serve, no sales call, bandwidth that never expires.GlossarySOCKS5SOCKS5 is a proxy protocol, standardised in RFC 1928 in 1996, that relays TCP connections and UDP datagrams between a client and a destination without interpreting the application traffic, with username/password authentication defined separately in RFC 1929.Glossarysocks5hsocks5h is the proxy URL scheme that tells a client to use a SOCKS5 proxy and send it the destination hostname, so the proxy resolves DNS; with socks5 the client resolves the name itself and sends the proxy only an IP address. curl defines socks5h:// as the equivalent of its --socks5-hostname option, and Python requests follows curl.GlossaryDNS leakA DNS leak is when a client sends its traffic through a proxy or VPN but resolves hostnames through its own local resolver, so the lookups leave from the original network — exposing which sites you visit to that resolver and, for location-dependent services, possibly connecting you to a server picked for the wrong place.IntegrationcurlSend curl through an authenticated proxy with -x and -U, check the exit IP, test sticky sessions and countries, use socks5h, and read 407 failures.IntegrationPython requestsUse an authenticated proxy with Python requests: the proxies argument, sticky sessions per task, geo-targeting, SOCKS5 and retries that skip 407 errors.GuideFix ERR_NO_SUPPORTED_PROXIESERR_NO_SUPPORTED_PROXIES: Chrome rejected your proxy setting before connecting. Credentials in --proxy-server or socks5h:// cause it. Seen on Chrome 156.Free toolProxy testerExit IP, location, latency per phase, rotation and header anonymity for one proxy, or a quick ping of a long list.