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 01:19:50 +0800

Hi,

In the source code /lib/socks.c, there's the following line:

bool socks5_resolve_local =
    (conn->socks_proxy.proxytype == CURLPROXY_SOCKS5) ? TRUE : FALSE;
See
https://github.com/curl/curl/blob/12d655d4561cfee0103c57e791c59a263863e561/lib/socks.c#L385

It define's a boolean variable socks5_resolve_local, which is a flag to
decide whether to resolve dns locally. Apparently when the proxy is a
socks5 proxy, it would be true.

But the locally resolved IP address may not be accessible for the socks5
proxy server, which lead to an error message like:

curl: (7) Failed to receive SOCKS5 connect request ack.

Therefore, I wonder why does the variable exists. How about to remove it to
enable remote dns resolve since the socks5 protocol supports domain name as
its address type. See https://tools.ietf.org/html/rfc1928.

What's more, browsers like firefox provides an configuration entry
`network.proxy.socks_remote_dns` to enable socks5 remote resolving.

As far as I'm concerned, it's better for curl to have this feature.

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