summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-12-01 17:19:12 -0500
committerJeff King <peff@peff.net>2015-12-01 17:19:12 -0500
commit92b9bf4a15346b8dae14772e07905ebb6ad29a47 (patch)
tree419bc1570474741102b5a9096ee36dd5666d1d15 /http.c
parentcd76778049e33c45376c67230c200c7e62ab7a35 (diff)
parent6d7afe07f29df75f831a46fb0f657fa37e561779 (diff)
downloadgit-92b9bf4a15346b8dae14772e07905ebb6ad29a47.tar.gz
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
Diffstat (limited to 'http.c')
-rw-r--r--http.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/http.c b/http.c
index 0f924a8b48..f0a5c05bc7 100644
--- a/http.c
+++ b/http.c
@@ -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);