mirror of
https://github.com/netchx/netch.git
synced 2026-03-28 18:59:46 +08:00
更新 Controller类
改善错误输出
This commit is contained in:
@@ -9,15 +9,13 @@ namespace Netch.Controllers
|
||||
{
|
||||
public PrivoxyController()
|
||||
{
|
||||
MainFile = "Privoxy";
|
||||
ExtFiles = new[] {"default.conf"};
|
||||
InitCheck();
|
||||
Name = "Privoxy";
|
||||
MainFile = "Privoxy.exe";
|
||||
RedirectStd = false;
|
||||
}
|
||||
|
||||
public bool Start(Server server, Mode mode)
|
||||
{
|
||||
if (!Ready) return false;
|
||||
|
||||
var isSocks5 = server.Type == "Socks5";
|
||||
var socks5Port = isSocks5 ? server.Port : Global.Settings.Socks5LocalPort;
|
||||
var text = File.ReadAllText("bin\\default.conf")
|
||||
@@ -28,7 +26,7 @@ namespace Netch.Controllers
|
||||
text = text.Replace("/ 127.0.0.1", $"/ {server.Hostname}");
|
||||
File.WriteAllText("data\\privoxy.conf", text);
|
||||
|
||||
Instance = GetProcess("bin\\Privoxy.exe", false);
|
||||
Instance = GetProcess();
|
||||
Instance.StartInfo.Arguments = "..\\data\\privoxy.conf";
|
||||
Instance.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
Instance.StartInfo.UseShellExecute = true;
|
||||
|
||||
Reference in New Issue
Block a user