]> git.saurik.com Git - apt.git/blobdiff - methods/https.cc
support all socks-proxy known to curl in https method
[apt.git] / methods / https.cc
index bbdbd8fa9d2fc0133907a8a7c762c524de67e6bb..50121ec4dd9739324230a376a7e76d91144cae85 100644 (file)
@@ -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());