Skip to content

Commit

Permalink
Merge branch 'pt/http-socks-proxy' into maint
Browse files Browse the repository at this point in the history
Add support for talking http/https over socks proxy.

* pt/http-socks-proxy:
  remote-http(s): support SOCKS proxies
  • Loading branch information
Jeff King committed Dec 1, 2015
2 parents cd76778 + 6d7afe0 commit 92b9bf4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)

if (curl_http_proxy) {
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
#if LIBCURL_VERSION_NUM >= 0x071800
if (starts_with(curl_http_proxy, "socks5"))
curl_easy_setopt(result,
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
else if (starts_with(curl_http_proxy, "socks4a"))
curl_easy_setopt(result,
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
else if (starts_with(curl_http_proxy, "socks"))
curl_easy_setopt(result,
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
#endif
}
#if LIBCURL_VERSION_NUM >= 0x070a07
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
Expand Down

0 comments on commit 92b9bf4

Please sign in to comment.