diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index 289188f..10dd126 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -221,6 +221,11 @@ + diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index 1bc6d80..0c6f8aa 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -551,13 +551,34 @@ namespace ProxySU } //MessageBox.Show(timesStamp2.ToString()); - //如果使用如果是WebSocket + TLS + Web模式,需要检测域名解析是否正确 - if (serverConfig.Contains("WebSocketTLSWeb") == true || serverConfig.Contains("http2") == true) + //如果使用如果是WebSocket + TLS + Web/http2/Http2Web/tcp_TLS/WebSocket_TLS模式,需要检测域名解析是否正确 + if (serverConfig.Contains("WebSocketTLSWeb") == true || serverConfig.Contains("http2") == true || serverConfig.Contains("Http2Web") == true || serverConfig.Contains("tcp_TLS") == true || serverConfig.Contains("WebSocket_TLS") == true) { currentStatus = "正在检测域名是否解析到当前VPS的IP上......"; textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus); Thread.Sleep(1000); + //在相应系统内安装curl(如果没有安装curl) + if (string.IsNullOrEmpty(client.RunCommand("command -v curl").Result) == true) + { + //为假则表示系统有相应的组件。 + if (getApt == false) + { + client.RunCommand("apt-get -qq update"); + client.RunCommand("apt-get -y -qq install curl"); + } + if (getYum == false) + { + client.RunCommand("yum -q makecache"); + client.RunCommand("yum -y -q install curl"); + } + if (getZypper == false) + { + client.RunCommand("zypper ref"); + client.RunCommand("zypper -y install curl"); + } + } + string nativeIp = client.RunCommand("curl -4 ip.sb").Result.ToString(); string testDomainCmd = "ping " + ReceiveConfigurationParameters[4] + " -c 1 | grep -oE -m1 \"([0-9]{1,3}\\.){3}[0-9]{1,3}\""; string resultCmd = client.RunCommand(testDomainCmd).Result.ToString(); diff --git a/ProxySU/bin/Release/ProxySU.exe b/ProxySU/bin/Release/ProxySU.exe index 73d70d3..0e022cc 100644 Binary files a/ProxySU/bin/Release/ProxySU.exe and b/ProxySU/bin/Release/ProxySU.exe differ diff --git a/ProxySU/bin/Release/Release.zip b/ProxySU/bin/Release/Release.zip index 74d4c79..8eb59cd 100644 Binary files a/ProxySU/bin/Release/Release.zip and b/ProxySU/bin/Release/Release.zip differ