mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 21:28:51 +00:00
Turn off system proxy when not using proxy to update subscriptions
This commit is contained in:
parent
1d4e5baafb
commit
7eafae98d4
1 changed files with 16 additions and 0 deletions
|
@ -178,6 +178,15 @@ namespace v2rayN.Handler
|
|||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
//Turn off system proxy
|
||||
bool bSysProxyType = false;
|
||||
if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
||||
{
|
||||
bSysProxyType = true;
|
||||
config.sysProxyType = ESysProxyType.ForcedClear;
|
||||
SysProxyHandle.UpdateSysProxy(config, false);
|
||||
}
|
||||
|
||||
foreach (var item in config.subItem)
|
||||
{
|
||||
if (item.enabled == false)
|
||||
|
@ -217,7 +226,14 @@ namespace v2rayN.Handler
|
|||
}
|
||||
_updateFunc(false, $"-------------------------------------------------------");
|
||||
}
|
||||
//restore system proxy
|
||||
if (bSysProxyType)
|
||||
{
|
||||
config.sysProxyType = ESysProxyType.ForcedChange;
|
||||
SysProxyHandle.UpdateSysProxy(config, false);
|
||||
}
|
||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue