feature: option page - set proxy
This commit is contained in:
@@ -439,12 +439,16 @@ namespace Pixiview.Utils
|
||||
{
|
||||
App.DebugPrint($"GET: {url}");
|
||||
var uri = new Uri(url);
|
||||
var proxy = Configs.Proxy;
|
||||
var handler = new HttpClientHandler
|
||||
{
|
||||
Proxy = Configs.Proxy,
|
||||
UseProxy = true,
|
||||
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
|
||||
};
|
||||
if (proxy != null)
|
||||
{
|
||||
handler.Proxy = proxy;
|
||||
handler.UseProxy = true;
|
||||
}
|
||||
var client = new HttpClient(handler)
|
||||
{
|
||||
BaseAddress = new Uri($"{uri.Scheme}://{uri.Host}")
|
||||
@@ -468,7 +472,11 @@ namespace Pixiview.Utils
|
||||
|
||||
public static class Configs
|
||||
{
|
||||
public static readonly WebProxy Proxy = new WebProxy("router.tsanie.us", 8088);
|
||||
public const string IsProxiedKey = "isProxied";
|
||||
public const string HostKey = "host";
|
||||
public const string PortKey = "port";
|
||||
|
||||
public static WebProxy Proxy;
|
||||
|
||||
public const int MaxThreads = 3;
|
||||
public const string Referer = "https://www.pixiv.net/";
|
||||
|
||||
Reference in New Issue
Block a user