Merge pull request #533 from samsong8610/master

Fixes #390 允许来自局域网的连接需要人工重启
pull/554/head
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

@ -352,6 +352,13 @@ namespace v2rayN.Forms
#endregion #endregion
#region http proxy 操作
private void RestartHttpProxy()
{
HttpProxyHandle.RestartHttpAgent(config, true);
}
#endregion
#region v2ray 操作 #region v2ray 操作
/// <summary> /// <summary>
@ -703,6 +710,7 @@ namespace v2rayN.Forms
//刷新 //刷新
RefreshServers(); RefreshServers();
LoadV2ray(); LoadV2ray();
RestartHttpProxy();
} }
} }

View File

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