mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-28 18:29:49 +02:00
Apply proxy settings to Lua API sockets
This commit is contained in:
@@ -518,10 +518,6 @@ namespace http
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_CONNECTTIMEOUT, curlConnectTimeoutS));
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_HTTPHEADER, handle->curlHeaders));
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_URL, handle->uri.c_str()));
|
||||
if (proxy.size())
|
||||
{
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_PROXY, proxy.c_str()));
|
||||
}
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_PRIVATE, (void *)handle));
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_USERAGENT, userAgent.c_str()));
|
||||
HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_HEADERDATA, (void *)handle));
|
||||
@@ -615,8 +611,10 @@ namespace http
|
||||
HandleCURLcode(curl_easy_setopt(easy, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE));
|
||||
#endif
|
||||
|
||||
auto &capath = http::RequestManager::Ref().Capath();
|
||||
auto &cafile = http::RequestManager::Ref().Cafile();
|
||||
auto &rm = http::RequestManager::Ref();
|
||||
auto &capath = rm.Capath();
|
||||
auto &cafile = rm.Cafile();
|
||||
auto &proxy = rm.Proxy();
|
||||
if (capath.size())
|
||||
{
|
||||
HandleCURLcode(curl_easy_setopt(easy, CURLOPT_CAPATH, capath.c_str()));
|
||||
@@ -629,5 +627,9 @@ namespace http
|
||||
{
|
||||
UseSystemCertProvider(easy);
|
||||
}
|
||||
if (proxy.size())
|
||||
{
|
||||
HandleCURLcode(curl_easy_setopt(easy, CURLOPT_PROXY, proxy.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -99,6 +99,11 @@ namespace http
|
||||
return capath;
|
||||
}
|
||||
|
||||
const ByteString &Proxy() const
|
||||
{
|
||||
return proxy;
|
||||
}
|
||||
|
||||
static RequestManagerPtr Create(ByteString newProxy, ByteString newCafile, ByteString newCapath, bool newDisableNetwork);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user