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

增加QUIC模式的模板安装

This commit is contained in:
ProxySU 2020-04-08 13:22:57 +08:00
parent 7322f827c3
commit a123af0a11
8 changed files with 446 additions and 97 deletions

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProxySU"
mc:Ignorable="d"
Title="ProxySU" Height="550" Width="820">
Title="ProxySU" Height="600" Width="900">
<!--以下样式参考自https://yq.aliyun.com/articles/331878
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
<Window.Resources>
@ -34,7 +34,12 @@
</Window.Resources>
<Grid>
<TabControl>
<TabItem Header="应用布署" Width="150" Height="30">
<!--<TabItem Header="V2ray配置生成器" Width="110" Height="30">
<Grid>
</Grid>
</TabItem>-->
<TabItem Header="应用布署" Width="110" Height="30">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
@ -113,6 +118,8 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button x:Name="ButtonGuideConfiguration" Visibility="Visible" Content="启用向导" Grid.Column="0" Grid.Row="0" Click="ButtonGuideConfiguration_Click"></Button>
<TextBlock Text="通过向导生成配置文件" Visibility="Visible" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
@ -146,17 +153,21 @@
<TabItem Header="测试面板" Visibility="Visible" Width="150" Height="30">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="101*"></ColumnDefinition>
<ColumnDefinition Width="44*"/>
<ColumnDefinition Width="145*"></ColumnDefinition>
<ColumnDefinition Width="145*"></ColumnDefinition>
<ColumnDefinition Width="145*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<!--<Button Content="更改SELinux模式" Grid.Column="0" Grid.Row="0" Margin="10" Click="Button_Click"></Button>-->
<Button x:Name="testresultClientInform" Content="测试结果窗口" Grid.Column="0" Grid.Row="1" Margin="5" Click="TestresultClientInform_Click"></Button>
</Grid>
</TabItem>
</TabControl>
@ -166,7 +177,7 @@
<Button x:Name="Button_canel" Content="取消" Grid.ColumnSpan="2" Margin="10" Grid.Column="2" Grid.Row="11" Click="Button_canel_Click"></Button>
</Grid>
</TabItem>
<TabItem Header="资源工具" Width="150" Height="30">
<TabItem Header="资源工具" Width="110" Height="30">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>

View File

@ -40,7 +40,8 @@ namespace ProxySU
//ReceiveConfigurationParameters[2]----uuid
//ReceiveConfigurationParameters[3]----path
//ReceiveConfigurationParameters[4]----domain
//ReceiveConfigurationParameters[5]----mKCP伪装类型
//ReceiveConfigurationParameters[5]----伪装类型
//ReceiveConfigurationParameters[6]----QUIC密钥
//public static ConnectionInfo ConnectionInfo;
public MainWindow()
{
@ -49,7 +50,7 @@ namespace ProxySU
RadioButtonNoProxy.IsChecked = true;
RadioButtonProxyNoLogin.IsChecked = true;
RadioButtonSocks4.Visibility = Visibility.Collapsed;
ReceiveConfigurationParameters = new string[6];
ReceiveConfigurationParameters = new string[7];
}
@ -218,13 +219,14 @@ namespace ProxySU
serverConfig = "TemplateConfg\\HTTP2_server_config.json";
clientConfig = "TemplateConfg\\tcp_client_config.json";
}
else if (String.Equals(ReceiveConfigurationParameters[0], "TLS"))
else if (String.Equals(ReceiveConfigurationParameters[0], "QuicNone") || String.Equals(ReceiveConfigurationParameters[0], "QuicSRTP") || String.Equals(ReceiveConfigurationParameters[0], "Quic2uTP") || String.Equals(ReceiveConfigurationParameters[0], "QuicWechatVideo") || String.Equals(ReceiveConfigurationParameters[0], "QuicDTLS") || String.Equals(ReceiveConfigurationParameters[0], "QuicWireGuard"))
{
//File.Copy("TemplateConfg\\tcp_server_config.json", "ConfigUpload\\tcp_server_config.json", true);
serverConfig = "TemplateConfg\\TLS_server_config.json";
clientConfig = "TemplateConfg\\tcp_client_config.json";
serverConfig = "TemplateConfg\\quic_server_config.json";
clientConfig = "TemplateConfg\\quic_client_config.json";
}
//Thread thread
Thread thread = new Thread(() => StartSetUpRemoteHost(connectionInfo, TextBlockSetUpProcessing, ProgressBarSetUpProcessing, serverConfig, clientConfig, upLoadPath));
thread.SetApartmentState(ApartmentState.STA);
@ -579,23 +581,29 @@ namespace ProxySU
using (StreamReader reader = File.OpenText(serverConfig))
{
JObject serverJson = (JObject)JToken.ReadFrom(new JsonTextReader(reader));
//设置uuid
serverJson["inbounds"][0]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2];
//除WebSocketTLSWeb模式外设置监听端口
if (serverConfig.Contains("WebSocketTLSWeb") == false)
{
serverJson["inbounds"][0]["port"] = ReceiveConfigurationParameters[1];
}
serverJson["inbounds"][0]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2];
//如果是WebSocketTLSWeb模式则设置路径
if (serverConfig.Contains("WebSocketTLSWeb") == true)
{
serverJson["inbounds"][0]["streamSettings"]["wsSettings"]["path"] = ReceiveConfigurationParameters[3];
}
//mkcp模式下设置伪装类型
if (serverConfig.Contains("mkcp") == true)
{
serverJson["inbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
}
//quic模式下设置伪装类型及密钥
if (serverConfig.Contains("quic") == true)
{
serverJson["inbounds"][0]["streamSettings"]["quicSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
serverJson["inbounds"][0]["streamSettings"]["quicSettings"]["key"] = ReceiveConfigurationParameters[6];
}
using (StreamWriter sw = new StreamWriter(@"config.json"))
{
@ -613,6 +621,8 @@ namespace ProxySU
//打开防火墙端口
string openFireWallPort = ReceiveConfigurationParameters[1];
if (String.IsNullOrEmpty(client.RunCommand("command -v firewall-cmd").Result) == false)
{
if (String.Equals(openFireWallPort, "443"))
{
client.RunCommand("firewall-cmd --zone=public --add-port=80/tcp --permanent");
@ -625,6 +635,22 @@ namespace ProxySU
client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/udp --permanent");
client.RunCommand("firewall-cmd --reload");
}
}
if (String.IsNullOrEmpty(client.RunCommand("command -v ufw").Result) == false)
{
if (String.Equals(openFireWallPort, "443"))
{
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("ufw reset");
}
else
{
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
client.RunCommand($"ufw allow {openFireWallPort}/udp");
client.RunCommand("ufw reset");
}
}
//如果是WebSocket + TLS + Web模式需要安装Caddy
if (serverConfig.Contains("WebSocketTLSWeb")==true)
@ -696,6 +722,11 @@ namespace ProxySU
{
clientJson["outbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
}
if (clientConfig.Contains("quic") == true)
{
clientJson["outbounds"][0]["streamSettings"]["quicSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
clientJson["outbounds"][0]["streamSettings"]["quicSettings"]["key"] = ReceiveConfigurationParameters[6];
}
using (StreamWriter sw = new StreamWriter(@"config\config.json"))
@ -961,6 +992,12 @@ namespace ProxySU
}
}
private void TestresultClientInform_Click(object sender, RoutedEventArgs e)
{
ResultClientInformation resultClientInformation = new ResultClientInformation();
resultClientInformation.ShowDialog();
}
//private void Button_Click(object sender, RoutedEventArgs e)
//{
// ConnectionInfo testconnect = GenerateConnectionInfo();

View File

@ -61,9 +61,12 @@
<TextBlock x:Name="TextBlockPath" Text="路径(Path)" Grid.Column="0" Grid.Row="8" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxPath" IsReadOnly="True" Grid.Column="1" Grid.Row="8" Margin="8"></TextBox>
<TextBlock x:Name="TextBlockPathExplain" Text="说明" Grid.Column="2" Grid.Row="8"></TextBlock>
<TextBlock x:Name="TextBlockQuicKey" Text="QUIC密钥" Grid.Column="0" Grid.Row="9" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxQuicKey" IsReadOnly="True" Grid.Column="1" Grid.Row="9" Margin="8"></TextBox>
<TextBlock x:Name="TextBlockQuicKeyExplain" Text="说明" Grid.Column="2" Grid.Row="9"></TextBlock>
<TextBlock Text="以上参数可以手动输入客户端用于V2ray官方客户端的配置文件已经存放入config目录下点击确定可打开" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="2" TextWrapping="Wrap"></TextBlock>
<Button Content="确定" Grid.Column="2" Grid.Row="9" Grid.RowSpan="2" Margin="20" Click="Button_Click"></Button>
<TextBlock Text="以上参数可以手动输入客户端用于V2ray官方客户端的配置文件已经存放入config目录下点击确定可打开" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="2" TextWrapping="Wrap"></TextBlock>
<Button x:Name="ButtonOpenSaveDir" Content="确定" Grid.Column="2" Grid.Row="10" Grid.RowSpan="1" Margin="5" Click="ButtonOpenSaveDir_Click"></Button>
<Grid Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="2" Grid.RowSpan="7">
<Grid>
<Grid.ColumnDefinitions>

View File

@ -30,8 +30,7 @@ namespace ProxySU
public ResultClientInformation()
{
InitializeComponent();
//主机地址
TextBoxHostAddress.Text = MainWindow.ReceiveConfigurationParameters[4];
//主机端口
TextBoxPort.Text = MainWindow.ReceiveConfigurationParameters[1];
//用户ID(uuid)
@ -40,16 +39,21 @@ namespace ProxySU
TextBoxUUIDextra.Text = "16";
//路径Path
TextBoxPath.Text = MainWindow.ReceiveConfigurationParameters[3];
//主机地址
TextBoxHostAddress.Text = MainWindow.ReceiveConfigurationParameters[4];
//加密方式一般都为auto
TextBoxEncryption.Text = "auto";
//伪装类型
TextBoxCamouflageType.Text = MainWindow.ReceiveConfigurationParameters[5];
//QUIC密钥
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS2Web"))
{
TextBoxTransmission.Text = "ws";
TextBoxCamouflageType.Text = "none";
ShowPathAndTLS();
HideQuicKey();
TextBoxTLS.Text = "tls";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCPhttp"))
@ -58,6 +62,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "http";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "MkcpNone"))
{
@ -65,6 +70,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "none";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP"))
{
@ -72,6 +78,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "srtp";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP"))
{
@ -79,6 +86,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "utp";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo"))
{
@ -86,6 +94,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "wechat-video";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS"))
{
@ -93,6 +102,7 @@ namespace ProxySU
TextBoxCamouflageType.Text = "dtls";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
{
@ -100,27 +110,85 @@ namespace ProxySU
TextBoxCamouflageType.Text = "wireguard";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "none";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicSRTP"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "srtp";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Quic2uTP"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "utp";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWechatVideo"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "wechat-video";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicDTLS"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "dtls";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWireGuard"))
{
TextBoxTransmission.Text = "quic";
TextBoxCamouflageType.Text = "wireguard";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePathAndTLS();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "HTTP2"))
{
TextBoxTransmission.Text = "h2";
TextBoxCamouflageType.Text = "none";
ShowPathAndTLS();
HideQuicKey();
TextBoxTLS.Text = "tls";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TLS"))
{
TextBoxTransmission.Text = "tcp";
TextBoxCamouflageType.Text = "none";
TextBoxTLS.Text = "tls";
HidePathAndTLS();
}
//else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TLS"))
//{
// TextBoxTransmission.Text = "tcp";
// TextBoxCamouflageType.Text = "none";
// TextBoxTLS.Text = "tls";
// HidePathAndTLS();
// HideQuicKey();
//}
else
{
TextBoxTransmission.Text = "tcp";
TextBoxCamouflageType.Text = "none";
TextBoxTLS.Text = "none";
HidePathAndTLS();
HideQuicKey();
}
CheckDir("config");
//if (!Directory.Exists("config"))//如果不存在就创建file文件夹     
@ -148,6 +216,24 @@ namespace ProxySU
//TextBoxTLS.Visibility = Visibility.Visible;
//TextBlocTLSonOrNoExplain.Visibility = Visibility.Visible;
}
private void HideQuicKey()
{
TextBlockQuicKey.Visibility = Visibility.Collapsed;
TextBoxQuicKey.Visibility = Visibility.Collapsed;
TextBlockQuicKeyExplain.Visibility = Visibility.Collapsed;
//TextBlocTLSonOrNo.Visibility = Visibility.Collapsed;
//TextBoxTLS.Visibility = Visibility.Collapsed;
//TextBlocTLSonOrNoExplain.Visibility = Visibility.Collapsed;
}
private void ShowQuicKey()
{
TextBlockQuicKey.Visibility = Visibility.Visible;
TextBoxQuicKey.Visibility = Visibility.Visible;
TextBlockQuicKeyExplain.Visibility = Visibility.Visible;
//TextBlocTLSonOrNo.Visibility = Visibility.Visible;
//TextBoxTLS.Visibility = Visibility.Visible;
//TextBlocTLSonOrNoExplain.Visibility = Visibility.Visible;
}
//生成v2rayN客户端导入文件
private void GenerateV2rayShareQRcodeAndBase64Url()
{
@ -169,15 +255,24 @@ namespace ProxySU
//MessageBox.Show(v2rayNjsonFile);
JObject v2rayNjsonObject = JObject.Parse(v2rayNjsonFile);
v2rayNjsonObject["v"] = "2";
v2rayNjsonObject["add"] = TextBoxHostAddress.Text.ToString(); //设置域名
v2rayNjsonObject["port"] = TextBoxPort.Text.ToString(); //设置端口
v2rayNjsonObject["id"] = TextBoxUUID.Text.ToString(); //设置uuid
v2rayNjsonObject["aid"] = TextBoxUUIDextra.Text.ToString(); //设置额外ID
v2rayNjsonObject["net"] = TextBoxTransmission.Text.ToString(); //设置传输模式
v2rayNjsonObject["type"] = TextBoxCamouflageType.Text.ToString(); //设置伪装类型
v2rayNjsonObject["add"] = TextBoxHostAddress.Text; //设置域名
v2rayNjsonObject["port"] = TextBoxPort.Text; //设置端口
v2rayNjsonObject["id"] = TextBoxUUID.Text; //设置uuid
v2rayNjsonObject["aid"] = TextBoxUUIDextra.Text; //设置额外ID
v2rayNjsonObject["net"] = TextBoxTransmission.Text; //设置传输模式
v2rayNjsonObject["type"] = TextBoxCamouflageType.Text; //设置伪装类型
if (TextBoxTransmission.Text.Contains("quic")==true)
{
v2rayNjsonObject["path"] = TextBoxQuicKey.Text;//设置quic密钥
v2rayNjsonObject["host"] = "chacha20-poly1305";
}
else
{
v2rayNjsonObject["path"] = TextBoxPath.Text; //设置路径
v2rayNjsonObject["host"] = "";
v2rayNjsonObject["path"] = TextBoxPath.Text.ToString(); //设置路径
v2rayNjsonObject["tls"] = TextBoxTLS.Text.ToString(); //设置是否启用TLS
}
v2rayNjsonObject["tls"] = TextBoxTLS.Text; //设置是否启用TLS
v2rayNjsonObject["ps"] = v2rayNjsonObject["add"]; //设置备注
//MessageBox.Show(v2rayNjsonObject["v"].ToString());
@ -270,7 +365,7 @@ namespace ProxySU
}
}
private void Button_Click(object sender, RoutedEventArgs e)
private void ButtonOpenSaveDir_Click(object sender, RoutedEventArgs e)
{
string openFolderPath = @"config\" + saveFileFolder;
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProxySU"
mc:Ignorable="d"
Title="TemplateConfiguration" Height="650" Width="650">
Title="TemplateConfiguration" Height="600" Width="850">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
@ -20,6 +20,7 @@
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
@ -33,31 +34,51 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonTCP" Content="TCP" Grid.Column="0" Grid.Row="0" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="TCP说明" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"></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>
<TextBlock Text="TCP+Http伪装说明" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButtonMkcpNoCamouflage" Content="mKCP(无伪装)" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="mkcp协议,不进行伪装,发送的数据是没有特征的数据包。" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="mkcp协议,伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" Grid.Column="0" Grid.Row="7" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" Grid.Column="0" Grid.Row="8" Checked="RadioButtonHTTP2_Checked"></RadioButton>
<TextBlock Text="目前是稳定性最好的使用Caddy做网站前置https数据流不易被识别出流量特征" TextWrapping="Wrap" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButtonHTTP2" Content="HTTP/2" Visibility="Collapsed" Grid.Column="0" Grid.Row="10" Checked="RadioButtonHTTP2_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Visibility="Collapsed" Grid.Column="1" Grid.Row="10" Grid.ColumnSpan="2"></TextBlock>
<RadioButton x:Name="RadioButtonTLS" Visibility="Collapsed" Content="TLS" Grid.Column="0" Grid.Row="9" Checked="RadioButtonHTTP2_Checked"></RadioButton>
<TextBlock Text="使用TLS加密数据流" Visibility="Collapsed" Grid.Column="1" Grid.Row="9" Grid.ColumnSpan="2"></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>
<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>
<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>
<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>
<TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" Grid.Column="0" Grid.Row="7" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" Grid.Column="0" Grid.Row="8" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" Grid.Column="0" Grid.Row="9" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="9" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" Grid.Column="0" Grid.Row="10" Checked="RadioButtonTCP_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="10" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicNone" Content="QUIC(无伪装)" Grid.Column="0" Grid.Row="12" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="数据加密传输无伪装会被识别为udp流量谷歌出品优点:减少延迟、多路复用、连接迁移" Grid.Column="1" Grid.Row="12" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicSRTP" Content="QUIC+SRTP" Grid.Column="0" Grid.Row="13" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="13" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuic2uTP" Content="QUIC+uTP" Grid.Column="0" Grid.Row="14" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="14" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicWechatVideo" Content="QUIC+WechatVideo" Grid.Column="0" Grid.Row="15" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同QUIC(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="15" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonQuicDTLS" Content="QUIC+DTLS 1.2" Grid.Column="0" Grid.Row="16" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<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>
<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>
</Grid>
</GroupBox>
<GroupBox Header="其他设置" Grid.Row="2">
@ -83,10 +104,10 @@
<TextBlock x:Name="TextBlockNewUUID" Text="UUID" Grid.Column="0" Grid.Row="1"></TextBlock>
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="5"></TextBox>
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="3" Grid.Row="1" Margin="5" Click="ButtonNewUUID_Click"></Button>
<TextBlock Text="使用已有UUID直接粘贴到框中" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>
<TextBlock x:Name="TextBlockExistingUUID" Text="使用现有UUID" Visibility="Collapsed" Grid.Column="0" Grid.Row="2"></TextBlock>
<TextBox x:Name="TextBoxExistingUUID" Visibility="Collapsed" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="5"></TextBox>
<Button x:Name="ButtonExistingUUID" Visibility="Collapsed" Content="粘贴到框中" Grid.Column="3" Grid.Row="2" Margin="5"></Button>
<TextBlock Text="使用已有UUID直接粘贴到框中" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2"></TextBlock>
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="5"></TextBox>
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="3" Grid.Row="2" Margin="5" Click="ButtonQuicUUID_Click"></Button>
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3"></TextBlock>
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="5"></TextBox>
<Button x:Name="ButtonPath" Content="随机" Grid.Column="3" Grid.Row="3" Margin="5" Click="ButtonPath_Click"></Button>

View File

@ -33,6 +33,12 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[0] = "TCP";
}
else if (RadioButtonTCPhttp.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp";
MainWindow.ReceiveConfigurationParameters[5] = "http";
}
else if (RadioButtonWebSocketTLS2Web.IsChecked == true)
{
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
@ -42,13 +48,20 @@ namespace ProxySU
}
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS2Web";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
else if (RadioButtonTCPhttp.IsChecked == true)
else if (RadioButtonHTTP2.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp";
MainWindow.ReceiveConfigurationParameters[5] = "http";
MainWindow.ReceiveConfigurationParameters[0] = "HTTP2";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
else if (RadioButtonMkcpNoCamouflage.IsChecked == true)
{
@ -86,16 +99,49 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard";
MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
}
else if (RadioButtonHTTP2.IsChecked == true)
else if (RadioButtonQuicNone.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "HTTP2";
MainWindow.ReceiveConfigurationParameters[0] = "QuicNone";
MainWindow.ReceiveConfigurationParameters[5] = "none";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else if (RadioButtonTLS.IsChecked == true)
else if (RadioButtonQuicSRTP.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TLS";
MainWindow.ReceiveConfigurationParameters[0] = "QuicSRTP";
MainWindow.ReceiveConfigurationParameters[5] = "srtp";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else if (RadioButtonQuic2uTP.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "Quic2uTP";
MainWindow.ReceiveConfigurationParameters[5] = "utp";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else if (RadioButtonQuicWechatVideo.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "QuicWechatVideo";
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else if (RadioButtonQuicDTLS.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "QuicDTLS";
MainWindow.ReceiveConfigurationParameters[5] = "dtls";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else if (RadioButtonQuicWireGuard.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "QuicWireGuard";
MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
else
{
//传递模板类型
@ -105,10 +151,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[1] = TextBoxServerListenPort.Text.ToString();
//传递uuid
MainWindow.ReceiveConfigurationParameters[2] = TextBoxNewUUID.Text.ToString();
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
this.Close();
}
@ -116,15 +159,22 @@ namespace ProxySU
#region
private void RadioButtonTCP_Checked(object sender, RoutedEventArgs e)
{
TextBlockServerListenPort.Visibility = Visibility.Visible;
TextBoxServerListenPort.Visibility = Visibility.Visible;
ButtonServerListenPort.Visibility = Visibility.Visible;
//TextBlockServerListenPort.Visibility = Visibility.Visible;
//TextBoxServerListenPort.Visibility = Visibility.Visible;
//ButtonServerListenPort.Visibility = Visibility.Visible;
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
ButtonQuicUUID.Visibility = Visibility.Collapsed;
TextBlockPath.Visibility = Visibility.Collapsed;
TextBoxPath.Visibility = Visibility.Collapsed;
ButtonPath.Visibility = Visibility.Collapsed;
TextBlockDomain.Visibility = Visibility.Collapsed;
TextBoxDomain.Visibility = Visibility.Collapsed;
ButtonDomain.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
Random random = new Random();
@ -134,35 +184,73 @@ namespace ProxySU
private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e)
{
TextBlockServerListenPort.Visibility = Visibility.Visible;
TextBoxServerListenPort.Visibility = Visibility.Visible;
//TextBlockServerListenPort.Visibility = Visibility.Visible;
//TextBoxServerListenPort.Visibility = Visibility.Visible;
//ButtonServerListenPort.Visibility = Visibility.Visible;
TextBoxServerListenPort.Text = "443";
ButtonServerListenPort.Visibility = Visibility.Visible;
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;
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
ButtonQuicUUID.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
}
private void RadioButtonTCPhttp_Checked(object sender, RoutedEventArgs e)
{
TextBlockServerListenPort.Visibility = Visibility.Visible;
TextBoxServerListenPort.Visibility = Visibility.Visible;
ButtonServerListenPort.Visibility = Visibility.Visible;
//TextBlockServerListenPort.Visibility = Visibility.Visible;
//TextBoxServerListenPort.Visibility = Visibility.Visible;
//ButtonServerListenPort.Visibility = Visibility.Visible;
TextBoxServerListenPort.Text = "80";
TextBlockPath.Visibility = Visibility.Collapsed;
TextBoxPath.Visibility = Visibility.Collapsed;
ButtonPath.Visibility = Visibility.Collapsed;
TextBlockDomain.Visibility = Visibility.Collapsed;
TextBoxDomain.Visibility = Visibility.Collapsed;
ButtonDomain.Visibility = Visibility.Collapsed;
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
ButtonQuicUUID.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
}
private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e)
{
TextBlockQuicUUID.Visibility = Visibility.Visible;
TextBoxQuicUUID.Visibility = Visibility.Visible;
ButtonQuicUUID.Visibility = Visibility.Visible;
TextBlockPath.Visibility = Visibility.Collapsed;
TextBoxPath.Visibility = Visibility.Collapsed;
ButtonPath.Visibility = Visibility.Collapsed;
TextBlockDomain.Visibility = Visibility.Collapsed;
TextBoxDomain.Visibility = Visibility.Collapsed;
ButtonDomain.Visibility = Visibility.Collapsed;
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
uuid = Guid.NewGuid();
TextBoxQuicUUID.Text = uuid.ToString();
Random random = new Random();
int randomServerPort = random.Next(10000, 50000);
TextBoxServerListenPort.Text = randomServerPort.ToString();
}
#endregion
//产生随机的uuid
private void ButtonNewUUID_Click(object sender, RoutedEventArgs e)
@ -170,6 +258,12 @@ namespace ProxySU
Guid uuid = Guid.NewGuid();
TextBoxNewUUID.Text = uuid.ToString();
}
//产生QUIC密钥所用的UUID
private void ButtonQuicUUID_Click(object sender, RoutedEventArgs e)
{
Guid uuid = Guid.NewGuid();
TextBoxQuicUUID.Text = uuid.ToString();
}
//产生随机服务端口
private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e)
{
@ -193,5 +287,9 @@ namespace ProxySU
{
}
}
}

View File

@ -0,0 +1,51 @@
{
"inbounds": [
{
"protocol": "http",
"port": 1081
},
{
"port": 1080,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth"
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": null,
"port": null,
"users": [
{
"id": null,
"alterId": 16
}
]
}
]
},
"streamSettings": {
"network": "quic",
"quicSettings": {
"security": "chacha20-poly1305",
"key": null,
"header": {
"type": null
}
}
}
}
]
}

View File

@ -0,0 +1,33 @@
{
"inbounds": [
{
"port": null,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": null,
"alterId": 64
}
]
},
"streamSettings": {
"network": "quic",
"quicSettings": {
"security": "chacha20-poly1305",
"key": null,
"header": {
"type": null
}
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}