curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

curl failed to connect with socks5.

From: Hongyi Zhao via curl-users <curl-users_at_cool.haxx.se>
Date: Fri, 4 Sep 2020 22:14:48 +0800

Hi,

On Ubuntu 20.04, I run Tor on 1270.0.0.1:9050 and do the following testings:

werner_at_X10DAi-01:~$ curl -vI -x socks5h://127.0.0.1:9050 www.baidu.com
* Trying 127.0.0.1:9050...
* TCP_NODELAY set
* SOCKS5 communication to www.baidu.com:80
* SOCKS5 connect to www.baidu.com:80 (remotely resolved)
* SOCKS5 request granted.
* Connected to 127.0.0.1 (127.0.0.1) port 9050 (#0)
> HEAD / HTTP/1.1
> Host: www.baidu.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Connection: keep-alive
Connection: keep-alive
< Content-Length: 277
Content-Length: 277
< Content-Type: text/html
Content-Type: text/html
< Date: Fri, 04 Sep 2020 14:07:35 GMT
Date: Fri, 04 Sep 2020 14:07:35 GMT
< Etag: "575e1f6f-115"
Etag: "575e1f6f-115"
< Last-Modified: Mon, 13 Jun 2016 02:50:23 GMT
Last-Modified: Mon, 13 Jun 2016 02:50:23 GMT
< Pragma: no-cache
Pragma: no-cache
< Server: bfe/1.0.8.18
Server: bfe/1.0.8.18

<
* Connection #0 to host 127.0.0.1 left intact

werner_at_X10DAi-01:~$ curl -vI -x socks5://127.0.0.1:9050 www.baidu.com
* Trying 127.0.0.1:9050...
* TCP_NODELAY set
* SOCKS5 communication to www.baidu.com:80
* SOCKS5 connect to IPv4 220.181.38.150:80 (locally resolved)
* Can't complete SOCKS5 connection to 220.181.38.150:80. (1)
* Closing connection 0
curl: (7) Can't complete SOCKS5 connection to 220.181.38.150:80. (1)

As you can see, the curl connection via sock5h protocol succeeded but
failed with the socks5. Any hints for this problem?

Regards,

-- 
Hongyi Zhao <hongyi.zhao_at_gmail.com>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-09-04