Temporary fix for proxy issue in CF Bypass block (only supports HTTP proxies for now).

This commit is contained in:
ruri
2019-04-30 00:05:55 +02:00
parent 6f867204f1
commit e20246eb5a
2 changed files with 15 additions and 1 deletions
+13 -1
View File
@@ -112,10 +112,22 @@ namespace RuriLib
if (data.UseProxies)
{
if (data.Proxy.Type != Extreme.Net.ProxyType.Http)
{
throw new Exception($"The proxy type {data.Proxy.Type} is not supported by this block yet");
}
var client = data.Proxy.GetClient();
var proxy = new WebProxy(data.Proxy.Proxy, false);
if (data.Proxy.Username != "")
{
proxy.Credentials = new NetworkCredential(data.Proxy.Username, data.Proxy.Password);
}
handler = new HttpClientHandler()
{
Proxy = (IWebProxy)client,
Proxy = proxy,
CookieContainer = cookies,
AllowAutoRedirect = true,
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate