Skip to content

Commit

Permalink
Update SysProxyHandle.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 17, 2019
1 parent b94d10d commit a922d3c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ static SysProxyHandle()

public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL)
{
Read();
//Read();

if (!_userSettings.UserSettingsRecorded)
{
// record user settings
ExecSysproxy("query");
ParseQueryStr(_queryStr);
}
//if (!_userSettings.UserSettingsRecorded)
//{
// // record user settings
// ExecSysproxy("query");
// ParseQueryStr(_queryStr);
//}

string arguments;
if (enable)
Expand All @@ -71,17 +71,19 @@ public static void SetIEProxy(bool enable, bool global, string proxyServer, stri
else
{
// restore user settings
var flags = _userSettings.Flags;
var proxy_server = _userSettings.ProxyServer ?? "-";
var bypass_list = _userSettings.BypassList ?? "-";
var pac_url = _userSettings.PacUrl ?? "-";
arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
//var flags = _userSettings.Flags;
//var proxy_server = _userSettings.ProxyServer ?? "-";
//var bypass_list = _userSettings.BypassList ?? "-";
//var pac_url = _userSettings.PacUrl ?? "-";
////arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
//set null settings
arguments = string.Format("set {0} {1} {2} {3}", 1, "-", "<local>", @"http://127.0.0.1");

// have to get new settings
_userSettings.UserSettingsRecorded = false;
//_userSettings.UserSettingsRecorded = false;
}

Save();
//Save();
ExecSysproxy(arguments);
}

Expand Down

0 comments on commit a922d3c

Please sign in to comment.