1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 22:56:09 +03:00

实现模板选择中各个选项卡中RadioButton的唯一选择

This commit is contained in:
ProxySU 2020-04-14 23:05:55 +08:00
parent 1dcd30377c
commit 6f36ee87e1
2 changed files with 185 additions and 38 deletions

View File

@ -35,12 +35,14 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<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="3">
<Grid> <Grid>
<TabControl> <TabControl x:Name="TabControlTemplate">
<TabItem Header="热门方案" Width="110" Height="30"> <TabItem x:Name="TabItemHot" Header="热门方案" Width="110" Height="30">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
@ -58,9 +60,12 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonWebSocketTLS2WebHot" Content="WebSocket+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="稳定性强使用Caddy做伪装网站隐藏代理会被识别为访问网站的https流量抗封锁识别最强。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="TCP传输协议" Width="110" Height="30"> <TabItem x:Name="TabItemTcp" Header="TCP传输协议" Width="110" Height="30">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
@ -78,21 +83,21 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonTCP" Content="TCP" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButtonTCP" Content="TCP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="数据加密传输会被识别为未知的tcp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输会被识别为未知的tcp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonTCPhttp" Content="TCP+Http伪装" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCPhttp_Checked" ></RadioButton> <RadioButton x:Name="RadioButtonTCPhttp" Content="TCP+Http伪装" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCPhttp_Checked" ></RadioButton>
<TextBlock Text="数据加密传输并做http伪装会被识别为http流量但并不是真正的http访问" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输并做http伪装会被识别为http流量但并不是真正的http访问" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonTCP2TLS" Content="TCP+TLS" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCPhttp_Checked" ></RadioButton> <RadioButton x:Name="RadioButtonTCP2TLS" Content="TCP+TLS" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP2TLS_Checked" />
<TextBlock Text="数据加密传输传输协议使用TLS会被识别为TLS流量不等同于https流量特征 (需要域名)" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输传输协议使用TLS会被识别为TLS流量不等同于https流量特征 (需要域名)" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonTCP2TLSnoDomain" Content="TCP+TLS((自签证书)" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCPhttp_Checked" ></RadioButton> <RadioButton x:Name="RadioButtonTCP2TLSnoDomain" Content="TCP+TLS((自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP2TLSnoDomain_Checked" />
<TextBlock Text="数据加密传输传输协议使用TLS会被识别为TLS流量不等同于https流量特征 (不需要域名)" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输传输协议使用TLS会被识别为TLS流量不等同于https流量特征 (无需域名)" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="WebSocket传输协议" Width="150" Height="30"> <TabItem Header="WebSocket传输协议" Width="150" Height="30">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition Width="1.2*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
@ -107,8 +112,14 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" Grid.Column="0" Grid.Row="3" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton> <RadioButton x:Name="RadioButtonWebSocket" Content="WebSocket" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="稳定性强使用Caddy做前置会被识别为访问网站的https流量抗封锁识别最强" TextWrapping="Wrap" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输传输协议使用WebSocket未启用TLS,将被识别为WebSocket流量。" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonWebSocketTLS" Content="WebSocket+TLS" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonHTTP2_Checked"/>
<TextBlock Text="数据加密传输传输协议使用WebSocket启用TLS,将被识别为TLS流量。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="稳定性强使用Caddy做伪装网站隐藏代理会被识别为访问网站的https流量抗封锁识别最强。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonWebSocketTLSnoDomain" Content="WebSocket+TLS(自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="数据加密传输传输协议使用WebSocket启用TLS,将被识别为TLS流量。(无需域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
</TabItem> </TabItem>
@ -130,11 +141,13 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonHTTP2" Content="HTTP/2" Grid.Column="0" Grid.Row="4" Checked="RadioButtonHTTP2_Checked"></RadioButton> <RadioButton x:Name="RadioButtonHTTP2" Content="HTTP/2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonHTTP2_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonHTTP2Web" Content="HTTP/2+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现,增加伪装网站" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="mKCP传输协议" Width="110" Height="30"> <TabItem Header="mKCP传输协议" Width="110" Height="30">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -154,17 +167,17 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonMkcpNoCamouflage" Content="mKCP(无伪装)" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButtonMkcpNoCamouflage" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="数据加密传输以增加流量消耗来加速减少延迟udp协议,无伪装会被识别为udp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输以增加流量消耗来加速减少延迟udp协议,无伪装会被识别为udp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton> <RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
@ -189,17 +202,17 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="提醒Shadowrocket目前暂不支持QUIC的传输模式。" Foreground="Red" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5"></TextBlock> <TextBlock Text="提醒Shadowrocket目前暂不支持QUIC的传输模式。" Foreground="Red" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5"></TextBlock>
<RadioButton x:Name="RadioButtonQuicNone" Content="QUIC(无伪装)" Grid.Column="0" Grid.Row="1" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuicNone" Content="QUIC(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="数据加密传输无伪装会被识别为udp流量谷歌出品优点:减少延迟、多路复用、连接迁移" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="数据加密传输无伪装会被识别为udp流量谷歌出品优点:减少延迟、多路复用、连接迁移" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicSRTP" Content="QUIC+SRTP" Grid.Column="0" Grid.Row="2" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuicSRTP" Content="QUIC+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同QUIC(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuic2uTP" Content="QUIC+uTP" Grid.Column="0" Grid.Row="3" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuic2uTP" Content="QUIC+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同QUIC(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicWechatVideo" Content="QUIC+WechatVideo" Grid.Column="0" Grid.Row="4" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuicWechatVideo" Content="QUIC+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同QUIC(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicDTLS" Content="QUIC+DTLS 1.2" Grid.Column="0" Grid.Row="5" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuicDTLS" Content="QUIC+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同QUIC(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicWireGuard" Content="QUIC+WireGuard" Grid.Column="0" Grid.Row="6" Checked="RadioButtonQuicNone_Checked"></RadioButton> <RadioButton x:Name="RadioButtonQuicWireGuard" Content="QUIC+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="同QUIC(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
</Grid> </Grid>
@ -207,7 +220,7 @@
</TabControl> </TabControl>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Header="其他设置" Grid.Row="2"> <GroupBox Header="其他设置" Grid.Row="3" Grid.RowSpan="2">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
@ -248,8 +261,9 @@
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" Margin="3"></TextBox> <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="6" Margin="2" Click="ButtondDecide_Click"></Button> <Button x:Name="ButtondDecide" Content="确定" Grid.Column="1" Grid.Row="6" Margin="0" Click="ButtondDecide_Click"></Button>
<Button x:Name="ButtondCancel" Content="取消" Grid.Column="3" Grid.Row="6" Margin="2" Click="ButtondCancel_Click"></Button> <Button x:Name="ButtondCancel" Content="取消" Grid.Column="3" Grid.Row="6" Margin="0" Click="ButtondCancel_Click"></Button>
<!--<Button x:Name="ButtonTestChecked" Content="测试选中状态" Grid.Column="5" Grid.Row="6" Click="ButtonTestChecked_Click"></Button>-->
</Grid> </Grid>
</GroupBox> </GroupBox>

View File

@ -10,6 +10,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
//using System.Windows.Forms;
namespace ProxySU namespace ProxySU
{ {
@ -23,23 +24,77 @@ namespace ProxySU
InitializeComponent(); InitializeComponent();
RadioButtonTCP.IsChecked = true; RadioButtonTCP.IsChecked = true;
} }
//取消不在当前活动选项卡中的其他所有选项卡中的所有RadioBuuton的选中状态
//代码参考网址https://blog.csdn.net/weixin_42583999/article/details/103468857
//调用UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
private void UncheckLayouts(TabItem activePage)
{
foreach (TabItem tabPage in TabControlTemplate.Items)
{
if (tabPage == activePage) continue;
Grid grid = (Grid)tabPage.Content;
foreach (UIElement element in grid.Children)
{
if (element is RadioButton)
{
RadioButton radiobutton = (element as RadioButton);
radiobutton.IsChecked = false;
}
}
}
}
private void ButtondDecide_Click(object sender, RoutedEventArgs e) private void ButtondDecide_Click(object sender, RoutedEventArgs e)
{ {
//UncheckLayouts(TabControlTemplate);
//TCP模式被选中
if (RadioButtonTCP.IsChecked == true) if (RadioButtonTCP.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TCP"; MainWindow.ReceiveConfigurationParameters[0] = "TCP";
} }
//TCP+http伪装模式被选中
else if (RadioButtonTCPhttp.IsChecked == true) else if (RadioButtonTCPhttp.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp"; MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp";
MainWindow.ReceiveConfigurationParameters[5] = "http"; MainWindow.ReceiveConfigurationParameters[5] = "http";
} }
else if (RadioButtonWebSocketTLS2Web.IsChecked == true) //TCP+TLS模式被选中
else if (RadioButtonTCP2TLS.IsChecked == true)
{
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
{
MessageBox.Show("域名不能为空!");
return;
}
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "tcpTLS";
//传递域名
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
//WebSocket+TLS模式被选中
else if (RadioButtonWebSocketTLS.IsChecked == true)
{
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
{
MessageBox.Show("域名不能为空!");
return;
}
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
//WebSocket+TLS+Web模式被选中
else if (RadioButtonWebSocketTLS2Web.IsChecked == true|| RadioButtonWebSocketTLS2WebHot.IsChecked==true)
{ {
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
{ {
@ -54,6 +109,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
//传递伪装网站 //传递伪装网站
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString();
//处理伪装网站域名中的前缀
string testDomain = TextBoxMaskSites.Text.Substring(0, 7); string testDomain = TextBoxMaskSites.Text.Substring(0, 7);
if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://")) if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://"))
{ {
@ -66,6 +122,7 @@ namespace ProxySU
} }
} }
//http2模式被选中
else if (RadioButtonHTTP2.IsChecked == true) else if (RadioButtonHTTP2.IsChecked == true)
{ {
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
@ -79,44 +136,51 @@ 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();
}
}
//mKCP无伪装模式被选中
else if (RadioButtonMkcpNoCamouflage.IsChecked == true) else if (RadioButtonMkcpNoCamouflage.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCPNone"; MainWindow.ReceiveConfigurationParameters[0] = "mKCPNone";
MainWindow.ReceiveConfigurationParameters[5] = "none"; MainWindow.ReceiveConfigurationParameters[5] = "none";
} }
//mKCP+srtp伪装模式被选中
else if (RadioButton2mKCP2SRTP.IsChecked == true) else if (RadioButton2mKCP2SRTP.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2SRTP"; MainWindow.ReceiveConfigurationParameters[0] = "mKCP2SRTP";
MainWindow.ReceiveConfigurationParameters[5] = "srtp"; MainWindow.ReceiveConfigurationParameters[5] = "srtp";
} }
//mKCP+utp伪装模式被选中
else if (RadioButton2mKCPuTP.IsChecked == true) else if (RadioButton2mKCPuTP.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCPuTP"; MainWindow.ReceiveConfigurationParameters[0] = "mKCPuTP";
MainWindow.ReceiveConfigurationParameters[5] = "utp"; MainWindow.ReceiveConfigurationParameters[5] = "utp";
} }
//mKCP+wechat-video伪装模式被选中
else if (RadioButton2mKCP2WechatVideo.IsChecked == true) else if (RadioButton2mKCP2WechatVideo.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WechatVideo"; MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WechatVideo";
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video"; MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
} }
//mKCP+dtls伪装模式被选中
else if (RadioButton2mKCP2DTLS.IsChecked == true) else if (RadioButton2mKCP2DTLS.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2DTLS"; MainWindow.ReceiveConfigurationParameters[0] = "mKCP2DTLS";
MainWindow.ReceiveConfigurationParameters[5] = "dtls"; MainWindow.ReceiveConfigurationParameters[5] = "dtls";
} }
//mKCP+wireguard伪装模式被选中
else if (RadioButton2mKCP2WireGuard.IsChecked == true) else if (RadioButton2mKCP2WireGuard.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard"; MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard";
MainWindow.ReceiveConfigurationParameters[5] = "wireguard"; MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
} }
//QUIC无伪装模式被选中
else if (RadioButtonQuicNone.IsChecked == true) else if (RadioButtonQuicNone.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -124,6 +188,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "none"; MainWindow.ReceiveConfigurationParameters[5] = "none";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//QUIC+srtp伪装模式被选中
else if (RadioButtonQuicSRTP.IsChecked == true) else if (RadioButtonQuicSRTP.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -131,6 +196,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "srtp"; MainWindow.ReceiveConfigurationParameters[5] = "srtp";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//QUIC+utp伪装模式被选中
else if (RadioButtonQuic2uTP.IsChecked == true) else if (RadioButtonQuic2uTP.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -138,6 +204,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "utp"; MainWindow.ReceiveConfigurationParameters[5] = "utp";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//QUIC+wechat-video伪装模式被选中
else if (RadioButtonQuicWechatVideo.IsChecked == true) else if (RadioButtonQuicWechatVideo.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -145,6 +212,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video"; MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//QUIC+dtls伪装模式被选中
else if (RadioButtonQuicDTLS.IsChecked == true) else if (RadioButtonQuicDTLS.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -152,6 +220,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "dtls"; MainWindow.ReceiveConfigurationParameters[5] = "dtls";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//QUIC+wireguard伪装模式被选中
else if (RadioButtonQuicWireGuard.IsChecked == true) else if (RadioButtonQuicWireGuard.IsChecked == true)
{ {
//传递模板类型 //传递模板类型
@ -159,7 +228,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[5] = "wireguard"; MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
} }
//默认模式为 TCP
else else
{ {
//传递模板类型 //传递模板类型
@ -174,6 +243,7 @@ namespace ProxySU
} }
private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close(); private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close();
#region #region
private void RadioButtonTCP_Checked(object sender, RoutedEventArgs e) private void RadioButtonTCP_Checked(object sender, RoutedEventArgs e)
{ {
@ -202,6 +272,8 @@ namespace ProxySU
Random random = new Random(); Random random = new Random();
int randomServerPort = random.Next(10000, 50000); int randomServerPort = random.Next(10000, 50000);
TextBoxServerListenPort.Text = randomServerPort.ToString(); TextBoxServerListenPort.Text = randomServerPort.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
} }
private void RadioButtonWebSocketTLS2Web_Checked(object sender, RoutedEventArgs e) private void RadioButtonWebSocketTLS2Web_Checked(object sender, RoutedEventArgs e)
{ {
@ -228,6 +300,8 @@ namespace ProxySU
Guid uuid = Guid.NewGuid(); Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString(); TextBoxNewUUID.Text = uuid.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
} }
private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e) private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e)
@ -255,6 +329,8 @@ namespace ProxySU
Guid uuid = Guid.NewGuid(); Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString(); TextBoxNewUUID.Text = uuid.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
} }
private void RadioButtonTCPhttp_Checked(object sender, RoutedEventArgs e) private void RadioButtonTCPhttp_Checked(object sender, RoutedEventArgs e)
{ {
@ -281,6 +357,8 @@ namespace ProxySU
Guid uuid = Guid.NewGuid(); Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString(); TextBoxNewUUID.Text = uuid.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
} }
private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e) private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e)
{ {
@ -309,8 +387,61 @@ namespace ProxySU
Random random = new Random(); Random random = new Random();
int randomServerPort = random.Next(10000, 50000); int randomServerPort = random.Next(10000, 50000);
TextBoxServerListenPort.Text = randomServerPort.ToString(); TextBoxServerListenPort.Text = randomServerPort.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
}
private void RadioButtonTCP2TLS_Checked(object sender, RoutedEventArgs e)
{
TextBoxServerListenPort.Text = "443";
//隐藏Path
TextBlockPath.Visibility = Visibility.Collapsed;
TextBoxPath.Visibility = Visibility.Collapsed;
//TextBoxPath.Text = "/ray";
ButtonPath.Visibility = Visibility.Collapsed;
//显示域名
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.Collapsed;
TextBoxMaskSites.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
}
private void RadioButtonTCP2TLSnoDomain_Checked(object sender, RoutedEventArgs e)
{
TextBoxServerListenPort.Text = "443";
//隐藏Path
TextBlockPath.Visibility = Visibility.Collapsed;
TextBoxPath.Visibility = Visibility.Collapsed;
//TextBoxPath.Text = "/ray";
ButtonPath.Visibility = Visibility.Collapsed;
//隐藏域名
TextBlockDomain.Visibility = Visibility.Collapsed;
TextBoxDomain.Visibility = Visibility.Collapsed;
//ButtonDomain.Visibility = Visibility.Visible;
//隐藏QUIC密钥
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
ButtonQuicUUID.Visibility = Visibility.Collapsed;
//隐藏伪装网站
TextBlockMaskSites.Visibility = Visibility.Collapsed;
TextBoxMaskSites.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
//清除其他选项卡中的选项
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
} }
#endregion #endregion
//产生随机的uuid //产生随机的uuid
private void ButtonNewUUID_Click(object sender, RoutedEventArgs e) private void ButtonNewUUID_Click(object sender, RoutedEventArgs e)
{ {
@ -347,8 +478,10 @@ namespace ProxySU
} }
//private void ButtonTestChecked_Click(object sender, RoutedEventArgs e)
//{
// UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
//}
} }
} }