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.

答复: Why resolve the dns locally when using a socks5 proxy

From: Qiying Wang via curl-users <curl-users_at_cool.haxx.se>
Date: Fri, 16 Aug 2019 02:22:42 +0800

> Socks5 allows the name to be resolved locally or remotely. curl supports both
ways.
>
> It already does. See --socks5-hostname or specify the proxy with --proxy
socks5h://host.example.com/.

-- 
Hi,
The option --socks5-hostname specify the proxy server’s host name.
But what I want is the following command line:
    curl --socks5 127.0.0.1:1080 https://google.com
The expected behavior is the socks5 proxy server to access https://google.com,
but the actually behavior is that curl first resolve the IP address of google.com,
then ask the proxy server to get https://ip.of.google.com.
Since my local dns was polluted, the proxy server cannot get the page and error occurred.

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-08-15