|
|
@@ -158,10 +158,18 @@ namespace Shadowsocks.Controller |
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (plugin.StartIfNeeded())
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (plugin.StartIfNeeded())
|
|
|
|
{
|
|
|
|
Logging.Info(
|
|
|
|
$"Started SIP003 plugin for {server.Identifier()} on {plugin.LocalEndPoint} - PID: {plugin.ProcessId}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
Logging.Info(
|
|
|
|
$"Started SIP003 plugin for {server.Identifier()} on {plugin.LocalEndPoint} - PID: {plugin.ProcessId}");
|
|
|
|
Logging.Error("Failed to start SIP003 plugin: " + ex.Message);
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
|
|
|
|
return plugin.LocalEndPoint;
|
|
|
@@ -526,6 +534,7 @@ namespace Shadowsocks.Controller |
|
|
|
strategy.ReloadServers();
|
|
|
|
}
|
|
|
|
|
|
|
|
StartPlugins();
|
|
|
|
privoxyRunner.Start(_config);
|
|
|
|
|
|
|
|
TCPRelay tcpRelay = new TCPRelay(this, _config);
|
|
|
@@ -563,6 +572,15 @@ namespace Shadowsocks.Controller |
|
|
|
Utils.ReleaseMemory(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void StartPlugins()
|
|
|
|
{
|
|
|
|
foreach (var server in _config.configs)
|
|
|
|
{
|
|
|
|
// Early start plugin processes
|
|
|
|
GetPluginLocalEndPointIfConfigured(server);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void SaveConfig(Configuration newConfig)
|
|
|
|
{
|
|
|
|
Configuration.Save(newConfig);
|
|
|
|