mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-02 21:36:17 +03:00
优化域名测试流程,stats-->null
This commit is contained in:
parent
17d40011c9
commit
a898314bb6
9 changed files with 59 additions and 79 deletions
|
@ -5,7 +5,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:ProxySU"
|
xmlns:local="clr-namespace:ProxySU"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="ProxySU - v2.4.22" Height="675" Width="650">
|
Title="ProxySU - v2.4.23 Beta2" Height="675" Width="650">
|
||||||
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
||||||
https://docs.microsoft.co/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
https://docs.microsoft.co/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
|
|
@ -7450,13 +7450,17 @@ namespace ProxySU
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(ipv6) == false)
|
if (String.IsNullOrEmpty(ipv6) == false)
|
||||||
{
|
{
|
||||||
//apiGithubCom = "api.githubipv6.ga";
|
|
||||||
//scriptGithubUrl = "raw.githubipv6.ga";
|
|
||||||
//githubCom = "github.githubipv6.ga";
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
FunctionResultErr();
|
||||||
|
client.Disconnect();
|
||||||
|
//****未检测到有效的IP地址......***
|
||||||
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_NoIpDetect").ToString();
|
||||||
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
MessageBox.Show(currentStatus);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7935,13 +7939,19 @@ namespace ProxySU
|
||||||
|
|
||||||
//检测主机是否为纯ipv6的主机
|
//检测主机是否为纯ipv6的主机
|
||||||
onlyIpv6 = OnlyIpv6HostDetect(client);
|
onlyIpv6 = OnlyIpv6HostDetect(client);
|
||||||
if(onlyIpv6 == true)
|
|
||||||
|
//如果未检测到有效的ip,连接就会被断开
|
||||||
|
if (client.IsConnected == false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (onlyIpv6 == true)
|
||||||
{
|
{
|
||||||
SetUpNat64(client, true);
|
SetUpNat64(client, true);
|
||||||
sshShellCommand = $"{sshCmdUpdate}";
|
sshShellCommand = $"{sshCmdUpdate}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
//****** "检测端口占用情况......" ******
|
//****** "检测端口占用情况......" ******
|
||||||
SetUpProgressBarProcessing(22);
|
SetUpProgressBarProcessing(22);
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_TestPortUsed").ToString();
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_TestPortUsed").ToString();
|
||||||
|
@ -8237,20 +8247,20 @@ namespace ProxySU
|
||||||
MainWindowsShowInfo(currentStatus);
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
|
||||||
//再次初始化相关变量
|
//再次初始化相关变量
|
||||||
ipv4 = String.Empty;
|
//ipv4 = String.Empty;
|
||||||
ipv6 = String.Empty;
|
//ipv6 = String.Empty;
|
||||||
onlyIpv6 = false;
|
//onlyIpv6 = false;
|
||||||
|
|
||||||
//sshShellCommand = @"curl -4 ip.sb";
|
//sshShellCommand = @"curl -4 ip.sb";
|
||||||
sshShellCommand = @"curl -s https://api.ip.sb/ip --ipv4 --max-time 8";
|
//sshShellCommand = @"curl -s https://api.ip.sb/ip --ipv4 --max-time 8";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
//currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
ipv4 = currentShellCommandResult.TrimEnd('\r', '\n');
|
//ipv4 = currentShellCommandResult.TrimEnd('\r', '\n');
|
||||||
|
|
||||||
sshShellCommand = @"curl -s https://api.ip.sb/ip --ipv6 --max-time 8";
|
//sshShellCommand = @"curl -s https://api.ip.sb/ip --ipv6 --max-time 8";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
//currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
ipv6 = currentShellCommandResult.TrimEnd('\r', '\n');
|
//ipv6 = currentShellCommandResult.TrimEnd('\r', '\n');
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(ipv4) == false)
|
if (onlyIpv6 == false)
|
||||||
{
|
{
|
||||||
string nativeIp = ipv4;
|
string nativeIp = ipv4;
|
||||||
|
|
||||||
|
@ -8264,75 +8274,42 @@ namespace ProxySU
|
||||||
SetUpProgressBarProcessing(36);
|
SetUpProgressBarProcessing(36);
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_DomainResolveOK").ToString();
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_DomainResolveOK").ToString();
|
||||||
MainWindowsShowInfo(currentStatus);
|
MainWindowsShowInfo(currentStatus);
|
||||||
onlyIpv6 = false;
|
//onlyIpv6 = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上!安装失败!" ******
|
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorDomainResolve").ToString();
|
|
||||||
MainWindowsShowInfo(currentStatus);
|
|
||||||
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上,请检查!若解析设置正确,请等待生效后再重试安装。如果域名使用了CDN,请先关闭!" ******
|
|
||||||
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorDomainResolve").ToString());
|
|
||||||
//client.Disconnect();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(ipv6) == false)
|
|
||||||
|
string nativeIp = ipv6;
|
||||||
|
|
||||||
|
//sshShellCommand = "ping6 " + ReceiveConfigurationParameters[4] + " -c1 | grep -oE -m1 \"([0-9]{1,3}\\.){3}[0-9]{1,3}\"";
|
||||||
|
sshShellCommand = $"dig @resolver1.opendns.com AAAA {ReceiveConfigurationParameters[4]} +short -6";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
|
string resultTestDomainCmd = currentShellCommandResult.TrimEnd('\r', '\n');
|
||||||
|
if (String.Equals(nativeIp, resultTestDomainCmd) == true)
|
||||||
{
|
{
|
||||||
string nativeIp = ipv6;
|
//****** "解析正确!OK!" ******12
|
||||||
|
SetUpProgressBarProcessing(36);
|
||||||
//sshShellCommand = "ping6 " + ReceiveConfigurationParameters[4] + " -c1 | grep -oE -m1 \"([0-9]{1,3}\\.){3}[0-9]{1,3}\"";
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_DomainResolveOK").ToString();
|
||||||
sshShellCommand = $"dig @resolver1.opendns.com AAAA {ReceiveConfigurationParameters[4]} +short -6";
|
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
|
||||||
|
|
||||||
string resultTestDomainCmd = currentShellCommandResult.TrimEnd('\r', '\n');
|
|
||||||
if (String.Equals(nativeIp, resultTestDomainCmd) == true)
|
|
||||||
{
|
|
||||||
//****** "解析正确!OK!" ******12
|
|
||||||
SetUpProgressBarProcessing(36);
|
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_DomainResolveOK").ToString();
|
|
||||||
MainWindowsShowInfo(currentStatus);
|
|
||||||
onlyIpv6 = true;
|
|
||||||
//apiGithubCom = "api.githubipv6.ga";
|
|
||||||
//scriptGithubUrl = "raw.githubipv6.ga";
|
|
||||||
//githubCom = "github.githubipv6.ga";
|
|
||||||
//纯ipv6主机,目前暂不支持
|
|
||||||
//currentStatus = Application.Current.FindResource("DisplayInstallInfo_OnlyIpv6").ToString();
|
|
||||||
//MainWindowsShowInfo(currentStatus);
|
|
||||||
//MessageBox.Show(currentStatus);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上!安装失败!" ******
|
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorDomainResolve").ToString();
|
|
||||||
MainWindowsShowInfo(currentStatus);
|
|
||||||
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上,请检查!若解析设置正确,请等待生效后再重试安装。如果域名使用了CDN,请先关闭!" ******
|
|
||||||
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorDomainResolve").ToString());
|
|
||||||
//client.Disconnect();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上!安装失败!" ******
|
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorDomainResolve").ToString();
|
|
||||||
MainWindowsShowInfo(currentStatus);
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
//onlyIpv6 = true;
|
||||||
|
|
||||||
//****** "域名未能正确解析到当前VPS的IP上,请检查!若解析设置正确,请等待生效后再重试安装。如果域名使用了CDN,请先关闭!" ******
|
return true;
|
||||||
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorDomainResolve").ToString());
|
|
||||||
//client.Disconnect();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//****** "域名未能正确解析到当前VPS的IP上!安装失败!" ******
|
||||||
//return true;
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorDomainResolve").ToString();
|
||||||
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
|
||||||
|
//****** "域名未能正确解析到当前VPS的IP上,请检查!若解析设置正确,请等待生效后再重试安装。如果域名使用了CDN,请先关闭!" ******
|
||||||
|
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorDomainResolve").ToString());
|
||||||
|
//client.Disconnect();
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.4.22.0")]
|
[assembly: AssemblyVersion("2.4.23.0")]
|
||||||
[assembly: AssemblyFileVersion("2.4.22.0")]
|
[assembly: AssemblyFileVersion("2.4.23.0")]
|
||||||
|
|
|
@ -293,6 +293,7 @@
|
||||||
<sys:String x:Key="DisplayInstallInfo_TimeOK">The time difference meets the requirements, OK!</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TimeOK">The time difference meets the requirements, OK!</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">is checking whether the domain name is resolved to the IP of the current VPS...</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">is checking whether the domain name is resolved to the IP of the current VPS...</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">is detecting whether it is a pure ipv6 host...</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">is detecting whether it is a pure ipv6 host...</sys:String>
|
||||||
|
<sys:String x:Key="DisplayInstallInfo_NoIpDetect">A valid IP address was not detected...</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">Finding the fastest Nat64 gateway...</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">Finding the fastest Nat64 gateway...</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">Failed to find a valid Nat64 gateway...</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">Failed to find a valid Nat64 gateway...</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">The fastest Nat64 gateway of the current host is:</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">The fastest Nat64 gateway of the current host is:</sys:String>
|
||||||
|
|
|
@ -298,6 +298,7 @@
|
||||||
<sys:String x:Key="DisplayInstallInfo_TimeOK">时间差符合要求,OK!</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TimeOK">时间差符合要求,OK!</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">正在检测域名是否解析到当前VPS的IP上......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">正在检测域名是否解析到当前VPS的IP上......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">正在检测是否为纯ipv6主机......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">正在检测是否为纯ipv6主机......</sys:String>
|
||||||
|
<sys:String x:Key="DisplayInstallInfo_NoIpDetect">未检测到有效的IP地址......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">正在查找最快的Nat64网关......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">正在查找最快的Nat64网关......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">未能找到有效的Nat64网关......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">未能找到有效的Nat64网关......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">当前主机最快的Nat64网关为:</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">当前主机最快的Nat64网关为:</sys:String>
|
||||||
|
|
|
@ -293,6 +293,7 @@
|
||||||
<sys:String x:Key="DisplayInstallInfo_TimeOK">時間差符合要求,OK!</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TimeOK">時間差符合要求,OK!</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">正在檢測域名是否解析到當前VPS的IP上......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_TestDomainResolve">正在檢測域名是否解析到當前VPS的IP上......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">正在檢測是否為純ipv6主機......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_OnlyIpv6HostDetect">正在檢測是否為純ipv6主機......</sys:String>
|
||||||
|
<sys:String x:Key="DisplayInstallInfo_NoIpDetect">未檢測到有效的IP地址......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">正在查找最快的Nat64網關......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64">正在查找最快的Nat64網關......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">未能找到有效的Nat64網關......</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestSetUpNat64Failed">未能找到有效的Nat64網關......</sys:String>
|
||||||
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">當前主機最快的Nat64網關為:</sys:String>
|
<sys:String x:Key="DisplayInstallInfo_FindFastestNat64AsIs">當前主機最快的Nat64網關為:</sys:String>
|
||||||
|
|
Binary file not shown.
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"stats": {}
|
"stats": null
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"stats": {}
|
"stats": null
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue