How to fix error: Can’t complete SOCKS5 connection to 0.0.0.0:0


Example error 1:

$ curl --socks5 localhost:11502 google.com
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (2)

Example error 2:

D:\cygwin64\bin>curl -i --socks5 localhost:1080 --proxy-user user:pass google.co
m
curl: (7) Failed to receive SOCKS5 connect request ack.

How to fix error?

Use option --socks5-hostname

Fix example 1:

D:\cygwin64\bin>curl --socks5-hostname 127.0.0.1:11502 google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Fix example 2:

D:\cygwin64\bin>curl -i --socks5 127.0.0.1:1080 --proxy-user user:pass google.co
m --socks5-hostname localhost
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Thu, 30 Jul 2020 07:41:51 GMT
Expires: Sat, 29 Aug 2020 07:41:51 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Leave a Reply