Merge pull request #533 from samsong8610/master

Fixes #390 允许来自局域网的连接需要人工重启
This commit is contained in:
2dust 2020-03-13 11:49:19 +08:00 committed by GitHub
commit c71caec9df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -348,12 +348,19 @@ namespace v2rayN.Forms
{
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
#endregion
#region http proxy
private void RestartHttpProxy()
{
HttpProxyHandle.RestartHttpAgent(config, true);
}
#endregion
#region v2ray
/// <summary>
/// 载入V2ray
/// </summary>
@ -703,6 +710,7 @@ namespace v2rayN.Forms
//刷新
RefreshServers();
LoadV2ray();
RestartHttpProxy();
}
}

View file

@ -121,6 +121,11 @@ namespace v2rayN.HttpProxyHandler
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
if (config.listenerType == 0)
{
// 关闭http proxy时直接返回
return;
}
//强制重启或者socks端口变化
if (forced)
{