Socks5 support username and password (#2768)

Co-authored-by: yangheran <heran.yang@seafile.com>
This commit is contained in:
feiniks 2024-05-09 16:21:06 +08:00 committed by GitHub
parent 8c2fe93154
commit d6d8954e87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -641,6 +641,10 @@ set_proxy (CURL *curl, gboolean is_https)
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
curl_easy_setopt(curl, CURLOPT_PROXY, seaf->http_proxy_addr);
curl_easy_setopt(curl, CURLOPT_PROXYPORT, seaf->http_proxy_port);
if (seaf->http_proxy_username && g_strcmp0 (seaf->http_proxy_username, "") != 0)
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, seaf->http_proxy_username);
if (seaf->http_proxy_password && g_strcmp0 (seaf->http_proxy_password, "") != 0)
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, seaf->http_proxy_password);
}
}