mirror of https://github.com/2dust/v2rayN
Add registry settings system proxy
parent
f747416d3b
commit
b9beb4be9d
|
@ -4,7 +4,6 @@ using System.Net;
|
|||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using v2rayN.Base;
|
||||
using v2rayN.Resx;
|
||||
|
||||
|
|
|
@ -79,10 +79,12 @@ namespace v2rayN.Handler
|
|||
.Replace("{http_port}", port.ToString())
|
||||
.Replace("{socks_port}", portSocks.ToString());
|
||||
}
|
||||
ProxySetting.SetProxy(strProxy, strExceptions, 2);
|
||||
SetIEProxy(true, strProxy, strExceptions);
|
||||
}
|
||||
else if (type == ESysProxyType.ForcedClear)
|
||||
{
|
||||
ProxySetting.UnsetProxy();
|
||||
ResetIEProxy();
|
||||
}
|
||||
else if (type == ESysProxyType.Unchanged)
|
||||
|
@ -92,6 +94,7 @@ namespace v2rayN.Handler
|
|||
{
|
||||
PacHandler.Start(Utils.GetConfigPath(), port, portPac);
|
||||
var strProxy = $"{Global.httpProtocol}{Global.Loopback}:{portPac}/pac?t={DateTime.Now.Ticks}";
|
||||
ProxySetting.SetProxy(strProxy, "", 4);
|
||||
SetIEProxy(false, strProxy, "");
|
||||
}
|
||||
|
||||
|
@ -129,22 +132,9 @@ namespace v2rayN.Handler
|
|||
}
|
||||
|
||||
// set system proxy to 1 (null) (null) (null)
|
||||
public static bool ResetIEProxy()
|
||||
public static void ResetIEProxy()
|
||||
{
|
||||
try
|
||||
{
|
||||
// clear user-wininet.json
|
||||
//_userSettings = new SysproxyConfig();
|
||||
//Save();
|
||||
// clear system setting
|
||||
ExecSysproxy("set 1 - - -");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
ExecSysproxy("set 1 - - -");
|
||||
}
|
||||
|
||||
private static void ExecSysproxy(string arguments)
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
public List<string> alpn { get; set; }
|
||||
public Utls4Sbox utls { get; set; }
|
||||
public Reality4Sbox reality { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class Multiplex4Sbox
|
||||
{
|
||||
|
@ -152,7 +152,7 @@
|
|||
public string strategy { get; set; }
|
||||
public string detour { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class Experimental4Sbox
|
||||
{
|
||||
public V2ray_Api4Sbox v2ray_api { get; set; }
|
||||
|
|
|
@ -693,6 +693,7 @@
|
|||
Grid.Column="1"
|
||||
Width="300"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
IsEditable="True"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
|
|
Loading…
Reference in New Issue