Skip to content

Commit 92b9bf4

Browse files
committed
Merge branch 'pt/http-socks-proxy' into maint
Add support for talking http/https over socks proxy. * pt/http-socks-proxy: remote-http(s): support SOCKS proxies
2 parents cd76778 + 6d7afe0 commit 92b9bf4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

http.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
465465

466466
if (curl_http_proxy) {
467467
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
468+
#if LIBCURL_VERSION_NUM >= 0x071800
469+
if (starts_with(curl_http_proxy, "socks5"))
470+
curl_easy_setopt(result,
471+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
472+
else if (starts_with(curl_http_proxy, "socks4a"))
473+
curl_easy_setopt(result,
474+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
475+
else if (starts_with(curl_http_proxy, "socks"))
476+
curl_easy_setopt(result,
477+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
478+
#endif
468479
}
469480
#if LIBCURL_VERSION_NUM >= 0x070a07
470481
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);

0 commit comments

Comments
 (0)