mirror of https://github.com/2dust/v2rayN
Improve subscription update without proxy
parent
bf396f8802
commit
77fbddf488
|
@ -188,9 +188,11 @@ namespace v2rayN.Handler
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
|
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
|
||||||
|
var webProxy = GetWebProxy(blProxy);
|
||||||
var client = new HttpClient(new SocketsHttpHandler()
|
var client = new HttpClient(new SocketsHttpHandler()
|
||||||
{
|
{
|
||||||
Proxy = GetWebProxy(blProxy)
|
Proxy = webProxy,
|
||||||
|
UseProxy = webProxy != null
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Utils.IsNullOrEmpty(userAgent))
|
if (Utils.IsNullOrEmpty(userAgent))
|
||||||
|
|
|
@ -164,14 +164,14 @@ namespace v2rayN.Handler
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
//Turn off system proxy
|
//Turn off system proxy
|
||||||
bool bSysProxyType = false;
|
//bool bSysProxyType = false;
|
||||||
if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
//if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
||||||
{
|
//{
|
||||||
bSysProxyType = true;
|
// bSysProxyType = true;
|
||||||
config.sysProxyType = ESysProxyType.ForcedClear;
|
// config.sysProxyType = ESysProxyType.ForcedClear;
|
||||||
SysProxyHandle.UpdateSysProxy(config, false);
|
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||||
Thread.Sleep(3000);
|
// Thread.Sleep(3000);
|
||||||
}
|
//}
|
||||||
|
|
||||||
foreach (var item in subItem)
|
foreach (var item in subItem)
|
||||||
{
|
{
|
||||||
|
@ -235,12 +235,12 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
_updateFunc(false, "-------------------------------------------------------");
|
_updateFunc(false, "-------------------------------------------------------");
|
||||||
}
|
}
|
||||||
//restore system proxy
|
////restore system proxy
|
||||||
if (bSysProxyType)
|
//if (bSysProxyType)
|
||||||
{
|
//{
|
||||||
config.sysProxyType = ESysProxyType.ForcedChange;
|
// config.sysProxyType = ESysProxyType.ForcedChange;
|
||||||
SysProxyHandle.UpdateSysProxy(config, false);
|
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||||
}
|
//}
|
||||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue