Skip to content

Commit 1c4f476

Browse files
committed
Merge branch 'jc/http-socks5h'
The socks5:// proxy support added back in 2.6.4 days was not aware that socks5h:// proxies behave differently. * jc/http-socks5h: http: differentiate socks5:// and socks5h://
2 parents 33e4ec8 + 87f8a0b commit 1c4f476

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

http.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,10 @@ static CURL *get_curl_handle(void)
605605
if (curl_http_proxy) {
606606
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
607607
#if LIBCURL_VERSION_NUM >= 0x071800
608-
if (starts_with(curl_http_proxy, "socks5"))
608+
if (starts_with(curl_http_proxy, "socks5h"))
609+
curl_easy_setopt(result,
610+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
611+
else if (starts_with(curl_http_proxy, "socks5"))
609612
curl_easy_setopt(result,
610613
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
611614
else if (starts_with(curl_http_proxy, "socks4a"))

0 commit comments

Comments
 (0)