From 87d97c2f043b7dd23078f979a8fa05eb3ffa1970 Mon Sep 17 00:00:00 2001 From: Space Time Date: Mon, 23 Dec 2024 22:06:35 +0800 Subject: [PATCH] =?UTF-8?q?1.1.4=20->=201.1.5=20=E7=AC=AC2=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Wins/MainWin.xaml.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index b3f5def..304450e 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -329,8 +329,6 @@ public partial class MainWin : Window { await NginxCleaner.Clean(); - NginxHttpPort = 80; - NginxHttpsPort = 443; NginxConfWatcher_Changed(null!, null!); }; @@ -394,11 +392,7 @@ public partial class MainWin : Window else foreach (Process mihomoProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath))) { - mihomoProcess.Exited += (_, _) => - { - MihomoMixedPort = 7880; - MihomoConfWatcher_Changed(null!, null!); - }; + mihomoProcess.Exited += (_, _) => MihomoConfWatcher_Changed(null!, null!); mihomoProcess.Kill(); } @@ -653,6 +647,9 @@ public partial class MainWin : Window if (!Directory.Exists(MainConst.NginxTempPath)) Directory.CreateDirectory(MainConst.NginxTempPath); + NginxHttpPort = 80; + NginxHttpsPort = 443; + foreach (IPEndPoint activeTcpListener in IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners()) if (activeTcpListener.Port == NginxHttpPort) NginxHttpPort++; @@ -725,6 +722,8 @@ public partial class MainWin : Window if (!File.Exists(MainConst.MihomoConfPath)) await File.Create(MainConst.MihomoConfPath).DisposeAsync(); + MihomoMixedPort = 7880; + foreach (IPEndPoint activeTcpListener in IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners()) if (activeTcpListener.Port == MihomoMixedPort) MihomoMixedPort++;