summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-31 18:46:34 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-10 23:19:44 +0200
commitd415fc795a69d6a5039964e88f97561183d6ab44 (patch)
tree367a8f69bb945c2e45e9f8ab41a0f9bf5b7a5257 /methods/https.cc
parent77a324fccc75b8573799a7f79ca1b3f8b0d35be7 (diff)
support all socks-proxy known to curl in https method
Diffstat (limited to 'methods/https.cc')
-rw-r--r--methods/https.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc
index bbdbd8fa9..50121ec4d 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -205,9 +205,20 @@ void HttpsMethod::SetupProxy() /*{{{*/
}
// Determine what host and port to use based on the proxy settings
- if (UseProxy.empty() == false)
+ if (UseProxy.empty() == false)
{
Proxy = UseProxy;
+ if (Proxy.Access == "socks5h")
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
+ else if (Proxy.Access == "socks5")
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+ else if (Proxy.Access == "socks4a")
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
+ else if (Proxy.Access == "socks")
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+ else
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+
if (Proxy.Port != 1)
curl_easy_setopt(curl, CURLOPT_PROXYPORT, Proxy.Port);
curl_easy_setopt(curl, CURLOPT_PROXY, Proxy.Host.c_str());