mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-03 13:53:36 +03:00
优化Caddyfile生成方法,并添加伪装网站设置
This commit is contained in:
parent
160627bddf
commit
b209b3ac2d
6 changed files with 224 additions and 60 deletions
|
@ -171,6 +171,7 @@
|
||||||
<Button x:Name="testresultClientInform" Content="测试结果窗口" Grid.Column="0" Grid.Row="1" Margin="5" Click="TestresultClientInform_Click"></Button>
|
<Button x:Name="testresultClientInform" Content="测试结果窗口" Grid.Column="0" Grid.Row="1" Margin="5" Click="TestresultClientInform_Click"></Button>
|
||||||
<Button x:Name="testPortOccupy" Content="测试端口占用" Grid.Column="0" Grid.Row="2" Margin="5" Click="TestPortOccupy_Click"></Button>
|
<Button x:Name="testPortOccupy" Content="测试端口占用" Grid.Column="0" Grid.Row="2" Margin="5" Click="TestPortOccupy_Click"></Button>
|
||||||
<Button x:Name="testInstalledV2ray" Content="测试是否安装V2ray" Grid.Column="1" Grid.Row="0" Margin="5" Click="TestInstalledV2ray_Click"></Button>
|
<Button x:Name="testInstalledV2ray" Content="测试是否安装V2ray" Grid.Column="1" Grid.Row="0" Margin="5" Click="TestInstalledV2ray_Click"></Button>
|
||||||
|
<Button x:Name="testsshCmd" Content="测试ssh命令" Grid.Column="1" Grid.Row="1" Margin="5" Click="TestsshCmd_Click"></Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace ProxySU
|
||||||
//ReceiveConfigurationParameters[4]----domain
|
//ReceiveConfigurationParameters[4]----domain
|
||||||
//ReceiveConfigurationParameters[5]----伪装类型
|
//ReceiveConfigurationParameters[5]----伪装类型
|
||||||
//ReceiveConfigurationParameters[6]----QUIC密钥
|
//ReceiveConfigurationParameters[6]----QUIC密钥
|
||||||
|
//ReceiveConfigurationParameters[7]----伪装网站
|
||||||
//public static ConnectionInfo ConnectionInfo;
|
//public static ConnectionInfo ConnectionInfo;
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
@ -50,7 +51,7 @@ namespace ProxySU
|
||||||
RadioButtonNoProxy.IsChecked = true;
|
RadioButtonNoProxy.IsChecked = true;
|
||||||
RadioButtonProxyNoLogin.IsChecked = true;
|
RadioButtonProxyNoLogin.IsChecked = true;
|
||||||
RadioButtonSocks4.Visibility = Visibility.Collapsed;
|
RadioButtonSocks4.Visibility = Visibility.Collapsed;
|
||||||
ReceiveConfigurationParameters = new string[7];
|
ReceiveConfigurationParameters = new string[8];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -726,29 +727,37 @@ namespace ProxySU
|
||||||
client.RunCommand("mkdir -p /var/www");
|
client.RunCommand("mkdir -p /var/www");
|
||||||
|
|
||||||
|
|
||||||
//currentStatus = "上传Caddy配置文件......";
|
currentStatus = "上传Caddy配置文件......";
|
||||||
//textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||||
//Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
serverConfig = "TemplateConfg\\WebSocketTLSWeb_server_config.caddyfile";
|
serverConfig = "TemplateConfg\\WebSocketTLSWeb_server_config.caddyfile";
|
||||||
upLoadPath = "/etc/caddy/Caddyfile";
|
upLoadPath = "/etc/caddy/Caddyfile";
|
||||||
UploadConfig(connectionInfo, serverConfig, upLoadPath);
|
UploadConfig(connectionInfo, serverConfig, upLoadPath);
|
||||||
//string[] splitDomain = ReceiveConfigurationParameters[4].Split('.');
|
|
||||||
|
|
||||||
//设置Caddyfile文件中的tls 邮箱
|
//设置Caddyfile文件中的tls 邮箱
|
||||||
string emailAddress = ReceiveConfigurationParameters[4];
|
string sshCmdEmail = $"email={ReceiveConfigurationParameters[4]};email=${{email/./@}};echo $email";//结尾有回车符
|
||||||
string sshCmd = $"email={emailAddress};email=${{email/./@}};sed -i \"s/off/${{email:=\"off\"}}/\" /etc/caddy/Caddyfile";
|
string email = client.RunCommand(sshCmdEmail).Result.Replace("\n", "");//删除结尾的回车符
|
||||||
|
string sshCmd = $"sed -i 's/off/{email}/' {upLoadPath}";//设置Caddyfile中的邮箱
|
||||||
client.RunCommand(sshCmd);
|
client.RunCommand(sshCmd);
|
||||||
client.RunCommand("sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath);
|
//设置Path
|
||||||
client.RunCommand("sed -i 's/##domain##/" + ReceiveConfigurationParameters[4] + "/' " + upLoadPath);
|
sshCmd = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[3]}/' {upLoadPath}";
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
//设置域名
|
||||||
|
sshCmd = $"sed -i 's/##domain##/{ReceiveConfigurationParameters[4]}/' {upLoadPath}";
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
//设置伪装网站
|
||||||
|
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[7])==false)
|
||||||
|
{
|
||||||
|
sshCmd = $"sed -i 's/##sites##/proxy \\/ {ReceiveConfigurationParameters[7]}/' {upLoadPath}";
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
}
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
//生成安装服务命令中的邮箱
|
|
||||||
string sshCmdEmail = $"email={emailAddress};email=${{email/./@}};echo $email";
|
|
||||||
string email= client.RunCommand(sshCmdEmail).Result.ToString();
|
|
||||||
//MessageBox.Show(email);
|
|
||||||
|
|
||||||
//安装Caddy服务
|
//安装Caddy服务
|
||||||
sshCmd = "caddy -service install -agree -conf /etc/caddy/Caddyfile -email " + email;
|
sshCmd = $"caddy -service install -agree -conf /etc/caddy/Caddyfile -email {email}";
|
||||||
//MessageBox.Show(sshCmd);
|
//MessageBox.Show(sshCmd);
|
||||||
client.RunCommand(sshCmd);
|
client.RunCommand(sshCmd);
|
||||||
|
|
||||||
|
@ -1196,19 +1205,59 @@ namespace ProxySU
|
||||||
using (var client = new SshClient(testconnect))
|
using (var client = new SshClient(testconnect))
|
||||||
{
|
{
|
||||||
client.Connect();
|
client.Connect();
|
||||||
string cmdTestPort = @"find / -name v2ray";
|
//string cmdTestPort = @"find / -name v2ray";
|
||||||
MessageBox.Show(cmdTestPort);
|
//MessageBox.Show(cmdTestPort);
|
||||||
string cmdResult = client.RunCommand(cmdTestPort).Result;
|
//string cmdResult = client.RunCommand(cmdTestPort).Result;
|
||||||
|
//设置Caddyfile文件中的tls 邮箱
|
||||||
|
string upLoadPath = "/etc/caddy/Caddyfile.test";
|
||||||
|
string emailAddress = ReceiveConfigurationParameters[4];
|
||||||
|
string sshCmdEmail = $"email={emailAddress};email=${{email/./@}};echo $email";//结尾有回车符
|
||||||
|
string email = client.RunCommand(sshCmdEmail).Result.Replace("\n","");
|
||||||
|
MessageBox.Show(email);
|
||||||
|
string sshCmd = $"sed -i 's/off/{email}/' {upLoadPath}";
|
||||||
|
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
sshCmd = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[3]}/' {upLoadPath}";
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
//sshCmd = "sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath;
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
//client.RunCommand("sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath);
|
||||||
|
sshCmd = $"sed -i 's/##domain##/{ReceiveConfigurationParameters[4]}/' {upLoadPath}";
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
//client.RunCommand("sed -i 's/##domain##/" + ReceiveConfigurationParameters[4] + "/' " + upLoadPath);
|
||||||
|
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[7]) == false)
|
||||||
|
{
|
||||||
|
sshCmd = $"sed -i 's/##sites##/proxy \\/ {ReceiveConfigurationParameters[7]}/' {upLoadPath}";
|
||||||
|
//client.RunCommand("sed -i 's/##sites##/proxy \\/ " + ReceiveConfigurationParameters[7] + "/' " + upLoadPath);
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
client.RunCommand(sshCmd);
|
||||||
|
}
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
|
//生成安装服务命令中的邮箱
|
||||||
|
//string sshCmdEmail = $"email={emailAddress};email=${{email/./@}};echo $email";
|
||||||
|
//string email = client.RunCommand(sshCmdEmail).Result.ToString();
|
||||||
|
|
||||||
|
//MessageBox.Show(email);
|
||||||
|
|
||||||
|
//安装Caddy服务
|
||||||
|
//sshCmd = "caddy -service install -agree -conf /etc/caddy/Caddyfile -email " + email;
|
||||||
|
sshCmd = $"caddy -service install -agree -conf /etc/caddy/Caddyfile -email {email}";
|
||||||
|
|
||||||
|
|
||||||
client.Disconnect();
|
client.Disconnect();
|
||||||
MessageBox.Show(cmdResult);
|
//MessageBox.Show(cmdResult);
|
||||||
if (cmdResult.Contains("/usr/bin/v2ray")==true)
|
//if (cmdResult.Contains("/usr/bin/v2ray")==true)
|
||||||
{
|
//{
|
||||||
MessageBox.Show("已安装");
|
// MessageBox.Show("已安装");
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
MessageBox.Show("未安装");
|
// MessageBox.Show("未安装");
|
||||||
}
|
//}
|
||||||
//string[] cmdResultArry = cmdResult.Split('\n');
|
//string[] cmdResultArry = cmdResult.Split('\n');
|
||||||
//foreach(string arry in cmdResultArry)
|
//foreach(string arry in cmdResultArry)
|
||||||
//{
|
//{
|
||||||
|
@ -1219,6 +1268,36 @@ namespace ProxySU
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TestsshCmd_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ReceiveConfigurationParameters[3] = "https://tes.te.tt";
|
||||||
|
ReceiveConfigurationParameters[7] = "http://77.77.77";
|
||||||
|
string upLoadPath = "/etc/caddy/Caddyfile";
|
||||||
|
string sshCmd = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[3]}/' {upLoadPath}";
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
//sshCmd = "sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath;
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
//sshCmd = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[3]}/' {upLoadPath}";
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
//sshCmd = "sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath;
|
||||||
|
//MessageBox.Show(sshCmd);
|
||||||
|
//client.RunCommand("sed -i 's/##path##/\\" + ReceiveConfigurationParameters[3] + "/' " + upLoadPath);
|
||||||
|
sshCmd = $"sed -i 's/##domain##/{ReceiveConfigurationParameters[4]}/' {upLoadPath}";
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
string testDomain = ReceiveConfigurationParameters[7].Substring(0,7);
|
||||||
|
if (String.Equals(testDomain,"https:/")||String.Equals(testDomain,"http://"))
|
||||||
|
{
|
||||||
|
MessageBox.Show(testDomain);
|
||||||
|
ReceiveConfigurationParameters[7]=ReceiveConfigurationParameters[7].Replace("/","\\/");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ReceiveConfigurationParameters[7] = "http:\\/\\/" + ReceiveConfigurationParameters[7];
|
||||||
|
}
|
||||||
|
sshCmd = $"sed -i 's/##sites##/proxy \\/ {ReceiveConfigurationParameters[7]}/' {upLoadPath}";
|
||||||
|
MessageBox.Show(sshCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//private void Button_Click(object sender, RoutedEventArgs e)
|
//private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
|
@ -6,13 +6,37 @@
|
||||||
xmlns:local="clr-namespace:ProxySU"
|
xmlns:local="clr-namespace:ProxySU"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="TemplateConfiguration" Height="600" Width="850">
|
Title="TemplateConfiguration" Height="600" Width="850">
|
||||||
|
<Window.Resources>
|
||||||
|
<Style BasedOn="{StaticResource {x:Type TextBox}}"
|
||||||
|
TargetType="TextBox"
|
||||||
|
x:Key="TitleText">
|
||||||
|
<Style.Triggers>
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Text" Value=""/>
|
||||||
|
<Condition Property="TextBox.IsFocused" Value="false"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Gray" Margin="0">
|
||||||
|
<TextBlock x:Name="MainTextBlock" Text="{TemplateBinding TextBox.Tag}" Width="{TemplateBinding TextBox.ActualWidth}" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</MultiTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<GroupBox Header="模板库" Grid.Row="0" Grid.RowSpan="2">
|
<GroupBox Header="模板库" Grid.Row="0" Grid.RowSpan="2">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
@ -48,11 +72,11 @@
|
||||||
<TextBlock Text="数据加密传输,会被识别为未知的tcp流量" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="数据加密传输,会被识别为未知的tcp流量" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<RadioButton x:Name="RadioButtonTCPhttp" Content="TCP+Http伪装" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCPhttp_Checked" ></RadioButton>
|
<RadioButton x:Name="RadioButtonTCPhttp" Content="TCP+Http伪装" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCPhttp_Checked" ></RadioButton>
|
||||||
<TextBlock Text="数据加密传输,并做http伪装,会被识别为http流量,但并不是真正的http访问" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="数据加密传输,并做http伪装,会被识别为http流量,但并不是真正的http访问" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" Grid.Column="0" Grid.Row="2" Checked="RadioButtonHTTP2_Checked"></RadioButton>
|
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" Grid.Column="0" Grid.Row="2" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
|
||||||
<TextBlock Text="稳定性强,使用Caddy做前置,会被识别为访问网站的https流量,抗封锁识别最强" TextWrapping="Wrap" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="稳定性强,使用Caddy做前置,会被识别为访问网站的https流量,抗封锁识别最强" TextWrapping="Wrap" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<RadioButton x:Name="RadioButtonHTTP2" Content="HTTP/2" Grid.Column="0" Grid.Row="3" Checked="RadioButtonHTTP2_Checked"></RadioButton>
|
<RadioButton x:Name="RadioButtonHTTP2" Content="HTTP/2" Grid.Column="0" Grid.Row="3" Checked="RadioButtonHTTP2_Checked"></RadioButton>
|
||||||
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
||||||
|
|
||||||
<RadioButton x:Name="RadioButtonMkcpNoCamouflage" Content="mKCP(无伪装)" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
|
<RadioButton x:Name="RadioButtonMkcpNoCamouflage" Content="mKCP(无伪装)" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||||
<TextBlock Text="数据加密传输,以增加流量消耗来加速,减少延迟,udp协议,无伪装,会被识别为udp流量" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="数据加密传输,以增加流量消耗来加速,减少延迟,udp协议,无伪装,会被识别为udp流量" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
|
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||||
|
@ -78,17 +102,20 @@
|
||||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="16" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="同QUIC(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="16" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<RadioButton x:Name="RadioButtonQuicWireGuard" Content="QUIC+WireGuard" Grid.Column="0" Grid.Row="17" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
<RadioButton x:Name="RadioButtonQuicWireGuard" Content="QUIC+WireGuard" Grid.Column="0" Grid.Row="17" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="17" Grid.ColumnSpan="3"></TextBlock>
|
<TextBlock Text="同QUIC(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="17" Grid.ColumnSpan="3"></TextBlock>
|
||||||
<TextBlock Text="提醒:Shadowrocket目前暂不支持QUIC的传输模式。" Grid.Column="0" Grid.Row="18" Grid.ColumnSpan="5"></TextBlock>
|
<TextBlock Text="提醒:Shadowrocket目前暂不支持QUIC的传输模式。" Foreground="Red" Grid.Column="0" Grid.Row="18" Grid.ColumnSpan="5"></TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Header="其他设置" Grid.Row="2">
|
<GroupBox Header="其他设置" Grid.Row="2">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition ></ColumnDefinition>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
|
@ -97,28 +124,32 @@
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0"></TextBlock>
|
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"></TextBlock>
|
||||||
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="5"></TextBox>
|
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="3" Grid.Row="0" Margin="5" Click="ButtonServerListenPort_Click"></Button>
|
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="4" Grid.Row="0" Margin="2" Click="ButtonServerListenPort_Click"></Button>
|
||||||
<TextBlock x:Name="TextBlockNewUUID" Text="UUID:" Grid.Column="0" Grid.Row="1"></TextBlock>
|
<TextBlock x:Name="TextBlockNewUUID" Text="UUID:" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
|
||||||
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="5"></TextBox>
|
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="3" Grid.Row="1" Margin="5" Click="ButtonNewUUID_Click"></Button>
|
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="4" Grid.Row="1" Margin="2" Click="ButtonNewUUID_Click"></Button>
|
||||||
<TextBlock Text="使用已有UUID,直接粘贴到框中" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>
|
<TextBlock Text="使用已有UUID,直接粘贴到框中" TextWrapping="Wrap" Grid.Column="5" Grid.Row="1" Grid.ColumnSpan="2" Margin="0"></TextBlock>
|
||||||
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2"></TextBlock>
|
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
|
||||||
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="5"></TextBox>
|
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="3" Grid.Row="2" Margin="5" Click="ButtonQuicUUID_Click"></Button>
|
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="4" Grid.Row="2" Margin="2" Click="ButtonQuicUUID_Click"></Button>
|
||||||
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3"></TextBlock>
|
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
|
||||||
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="5"></TextBox>
|
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
<Button x:Name="ButtonPath" Content="随机" Grid.Column="3" Grid.Row="3" Margin="5" Click="ButtonPath_Click"></Button>
|
<Button x:Name="ButtonPath" Content="随机" Grid.Column="4" Grid.Row="3" Margin="2" Click="ButtonPath_Click"></Button>
|
||||||
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4"></TextBlock>
|
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"></TextBlock>
|
||||||
<TextBox x:Name="TextBoxDomain" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Margin="5"></TextBox>
|
<TextBox x:Name="TextBoxDomain" Style="{StaticResource TitleText}" Tag="不可为空" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="3" Grid.Row="4" Margin="5" Click="ButtonDomain_Click"></Button>
|
<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="4" Grid.Row="4" Margin="5.333,5" Click="ButtonDomain_Click"></Button>
|
||||||
|
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2"></TextBlock>
|
||||||
|
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||||
|
|
||||||
<Button x:Name="ButtondDecide" Content="确定" Grid.Column="1" Grid.Row="5" Margin="4" Click="ButtondDecide_Click"></Button>
|
|
||||||
<Button x:Name="ButtondCancel" Content="取消" Grid.Column="2" Grid.Row="5" Margin="4" Click="ButtondCancel_Click" ></Button>
|
<Button x:Name="ButtondDecide" Content="确定" Grid.Column="1" Grid.Row="6" Margin="2" Click="ButtondDecide_Click"></Button>
|
||||||
|
<Button x:Name="ButtondCancel" Content="取消" Grid.Column="3" Grid.Row="6" Margin="2" Click="ButtondCancel_Click"></Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -52,6 +52,18 @@ namespace ProxySU
|
||||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||||
//传递域名
|
//传递域名
|
||||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||||
|
//传递伪装网站
|
||||||
|
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString();
|
||||||
|
string testDomain = TextBoxMaskSites.Text.Substring(0, 7);
|
||||||
|
if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://"))
|
||||||
|
{
|
||||||
|
//MessageBox.Show(testDomain);
|
||||||
|
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.Replace("/", "\\/");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindow.ReceiveConfigurationParameters[7] = "http:\\/\\/" + TextBoxMaskSites.Text;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (RadioButtonHTTP2.IsChecked == true)
|
else if (RadioButtonHTTP2.IsChecked == true)
|
||||||
|
@ -162,18 +174,22 @@ namespace ProxySU
|
||||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||||
|
//隐藏QUIC密钥
|
||||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏Path
|
||||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||||
ButtonPath.Visibility = Visibility.Collapsed;
|
ButtonPath.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏域名
|
||||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏伪装网站
|
||||||
|
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
|
||||||
Guid uuid = Guid.NewGuid();
|
Guid uuid = Guid.NewGuid();
|
||||||
TextBoxNewUUID.Text = uuid.ToString();
|
TextBoxNewUUID.Text = uuid.ToString();
|
||||||
|
@ -181,6 +197,32 @@ namespace ProxySU
|
||||||
int randomServerPort = random.Next(10000, 50000);
|
int randomServerPort = random.Next(10000, 50000);
|
||||||
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
||||||
}
|
}
|
||||||
|
private void RadioButtonWebSocketTLS2Web_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||||
|
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||||
|
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||||
|
TextBoxServerListenPort.Text = "443";
|
||||||
|
//显示Path
|
||||||
|
TextBlockPath.Visibility = Visibility.Visible;
|
||||||
|
TextBoxPath.Visibility = Visibility.Visible;
|
||||||
|
TextBoxPath.Text = "/ray";
|
||||||
|
ButtonPath.Visibility = Visibility.Visible;
|
||||||
|
//显示域名
|
||||||
|
TextBlockDomain.Visibility = Visibility.Visible;
|
||||||
|
TextBoxDomain.Visibility = Visibility.Visible;
|
||||||
|
ButtonDomain.Visibility = Visibility.Visible;
|
||||||
|
//隐藏QUIC密钥
|
||||||
|
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
//显示伪装网站
|
||||||
|
TextBlockMaskSites.Visibility = Visibility.Visible;
|
||||||
|
TextBoxMaskSites.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
Guid uuid = Guid.NewGuid();
|
||||||
|
TextBoxNewUUID.Text = uuid.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e)
|
private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -188,19 +230,22 @@ namespace ProxySU
|
||||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||||
TextBoxServerListenPort.Text = "443";
|
TextBoxServerListenPort.Text = "443";
|
||||||
|
//显示Path
|
||||||
TextBlockPath.Visibility = Visibility.Visible;
|
TextBlockPath.Visibility = Visibility.Visible;
|
||||||
TextBoxPath.Visibility = Visibility.Visible;
|
TextBoxPath.Visibility = Visibility.Visible;
|
||||||
TextBoxPath.Text = "/ray";
|
TextBoxPath.Text = "/ray";
|
||||||
ButtonPath.Visibility = Visibility.Visible;
|
ButtonPath.Visibility = Visibility.Visible;
|
||||||
|
//显示域名
|
||||||
TextBlockDomain.Visibility = Visibility.Visible;
|
TextBlockDomain.Visibility = Visibility.Visible;
|
||||||
TextBoxDomain.Visibility = Visibility.Visible;
|
TextBoxDomain.Visibility = Visibility.Visible;
|
||||||
ButtonDomain.Visibility = Visibility.Visible;
|
ButtonDomain.Visibility = Visibility.Visible;
|
||||||
|
//隐藏QUIC密钥
|
||||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏伪装网站
|
||||||
|
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
Guid uuid = Guid.NewGuid();
|
Guid uuid = Guid.NewGuid();
|
||||||
TextBoxNewUUID.Text = uuid.ToString();
|
TextBoxNewUUID.Text = uuid.ToString();
|
||||||
|
@ -211,35 +256,43 @@ namespace ProxySU
|
||||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||||
TextBoxServerListenPort.Text = "80";
|
TextBoxServerListenPort.Text = "80";
|
||||||
|
//隐藏Path
|
||||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||||
ButtonPath.Visibility = Visibility.Collapsed;
|
ButtonPath.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
//隐藏域名
|
||||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏QUIC密钥
|
||||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏伪装网站
|
||||||
|
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
Guid uuid = Guid.NewGuid();
|
Guid uuid = Guid.NewGuid();
|
||||||
TextBoxNewUUID.Text = uuid.ToString();
|
TextBoxNewUUID.Text = uuid.ToString();
|
||||||
}
|
}
|
||||||
private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e)
|
private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
//显示QUIC密钥
|
||||||
TextBlockQuicUUID.Visibility = Visibility.Visible;
|
TextBlockQuicUUID.Visibility = Visibility.Visible;
|
||||||
TextBoxQuicUUID.Visibility = Visibility.Visible;
|
TextBoxQuicUUID.Visibility = Visibility.Visible;
|
||||||
ButtonQuicUUID.Visibility = Visibility.Visible;
|
ButtonQuicUUID.Visibility = Visibility.Visible;
|
||||||
|
//隐藏Path
|
||||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||||
ButtonPath.Visibility = Visibility.Collapsed;
|
ButtonPath.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏域名
|
||||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||||
|
//隐藏伪装网站
|
||||||
|
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
Guid uuid = Guid.NewGuid();
|
Guid uuid = Guid.NewGuid();
|
||||||
TextBoxNewUUID.Text = uuid.ToString();
|
TextBoxNewUUID.Text = uuid.ToString();
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue