From 56cbb7ec098540992ee0328b1d19c790d471d6ca Mon Sep 17 00:00:00 2001 From: Space Time Date: Mon, 7 Oct 2024 13:38:48 +0800 Subject: [PATCH] =?UTF-8?q?1.1.1=20->=201.1.2=20=E7=AC=AC50=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 --- Consts/MainMultilangConst.Designer.cs | 9 +++++++++ Consts/MainMultilangConst.resx | 3 +++ Consts/MainMultilangConst.zh.resx | 3 +++ Wins/MainWin.xaml.cs | 8 +++++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Consts/MainMultilangConst.Designer.cs b/Consts/MainMultilangConst.Designer.cs index d27bf11..edceacc 100644 --- a/Consts/MainMultilangConst.Designer.cs +++ b/Consts/MainMultilangConst.Designer.cs @@ -159,6 +159,15 @@ namespace Sheas_Cealer.Consts { } } + /// + /// 查找类似 Warning: The proxy core is under attack and cannot forge SNI. The SNI removal mode has been turned on urgently. Do you want to continue? 的本地化字符串。 + /// + public static string _LaunchNginxFlashingPrompt { + get { + return ResourceManager.GetString("_LaunchNginxFlashingPrompt", resourceCulture); + } + } + /// /// 查找类似 Please remember to come back and stop the proxy manually after use. Do you want to continue? 的本地化字符串。 /// diff --git a/Consts/MainMultilangConst.resx b/Consts/MainMultilangConst.resx index 18ee287..54efb8a 100644 --- a/Consts/MainMultilangConst.resx +++ b/Consts/MainMultilangConst.resx @@ -285,6 +285,9 @@ All processes of the selected browser will be closed before launching. Do you want to continue? + + Warning: The proxy core is under attack and cannot forge SNI. The SNI removal mode has been turned on urgently. Do you want to continue? + Please remember to come back and stop the proxy manually after use. Do you want to continue? diff --git a/Consts/MainMultilangConst.zh.resx b/Consts/MainMultilangConst.zh.resx index 9d70a1a..4db1ca9 100644 --- a/Consts/MainMultilangConst.zh.resx +++ b/Consts/MainMultilangConst.zh.resx @@ -285,6 +285,9 @@ 启动前将关闭所选浏览器的所有进程,是否继续? + + Warning: 代理核心正在遭受攻击,无法伪造 SNI,已紧急开启 SNI 拔除模式,是否继续? + 使用完请务必记得回来手动关闭代理,是否继续? diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index 6300b6b..130d42e 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -182,8 +182,12 @@ public partial class MainWin : Window if (!MainPres!.IsNginxRunning) { + if (string.IsNullOrWhiteSpace(CealArgs)) + throw new Exception(MainConst._HostErrorMsg); if (MessageBox.Show(MainConst._LaunchProxyPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) return; + if (MainPres.IsFlashing && MessageBox.Show(MainConst._LaunchNginxFlashingPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) + return; if (!File.Exists(MainConst.NginxConfPath)) File.Create(MainConst.NginxConfPath).Dispose(); @@ -429,6 +433,7 @@ public partial class MainWin : Window { MessageBox.Show(MainConst._GameStartMsg); MainPres.IsFlashing = true; + NginxConfWatcher_Changed(null!, null!); Random random = new(); @@ -451,6 +456,7 @@ public partial class MainWin : Window } MainPres.IsFlashing = false; + NginxConfWatcher_Changed(null!, null!); MessageBox.Show(MainConst._GameEndingMsg); } else @@ -552,7 +558,7 @@ public partial class MainWin : Window .AddOrUpdate("worker_processes", "auto") .AddOrUpdate("events:worker_connections", "65536") .AddOrUpdate("http:proxy_set_header", "Host $http_host") - .AddOrUpdate("http:proxy_ssl_server_name", "on") + .AddOrUpdate("http:proxy_ssl_server_name", !MainPres.IsFlashing ? "on" : "off") .AddOrUpdate("http:server:return", "https://$host$request_uri"); foreach (List<(List<(string hostIncludeDomain, string hostExcludeDomain)> hostDomainPairs, string hostSni, string hostIp)> hostRules in HostRulesDict.Values)