mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Temporary fix for proxy issue in CF Bypass block (only supports HTTP proxies for now).
This commit is contained in:
@@ -28,6 +28,8 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="0 10 0 0"
|
Margin="0 10 0 0"
|
||||||
Foreground="{DynamicResource ForegroundMain}">
|
Foreground="{DynamicResource ForegroundMain}">
|
||||||
|
This block only works with HTTP proxies for now.
|
||||||
|
<LineBreak/><LineBreak/>
|
||||||
If the Cloudflare challenge needs a reCaptcha to be solved,
|
If the Cloudflare challenge needs a reCaptcha to be solved,
|
||||||
this block will check if you defined a 2captcha or anti-captcha API Key. If
|
this block will check if you defined a 2captcha or anti-captcha API Key. If
|
||||||
it finds one, it will be used to solve the challenges. <LineBreak/><LineBreak/>
|
it finds one, it will be used to solve the challenges. <LineBreak/><LineBreak/>
|
||||||
|
|||||||
@@ -112,10 +112,22 @@ namespace RuriLib
|
|||||||
|
|
||||||
if (data.UseProxies)
|
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 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()
|
handler = new HttpClientHandler()
|
||||||
{
|
{
|
||||||
Proxy = (IWebProxy)client,
|
Proxy = proxy,
|
||||||
CookieContainer = cookies,
|
CookieContainer = cookies,
|
||||||
AllowAutoRedirect = true,
|
AllowAutoRedirect = true,
|
||||||
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
|
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
|
||||||
|
|||||||
Reference in New Issue
Block a user