diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index 7067b30..391ca42 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -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"> @@ -34,7 +34,12 @@ - + + @@ -113,6 +118,8 @@ + + @@ -146,17 +153,21 @@ - - - - - + + + + + + + + + @@ -166,7 +177,7 @@ - + diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index 4a55022..b012588 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -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,24 +581,30 @@ 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")) { sw.Write(serverJson.ToString()); @@ -613,17 +621,35 @@ namespace ProxySU //打开防火墙端口 string openFireWallPort = ReceiveConfigurationParameters[1]; - if (String.Equals(openFireWallPort, "443")) + if (String.IsNullOrEmpty(client.RunCommand("command -v firewall-cmd").Result) == false) { - client.RunCommand("firewall-cmd --zone=public --add-port=80/tcp --permanent"); - client.RunCommand("firewall-cmd --zone=public --add-port=443/tcp --permanent"); - client.RunCommand("firewall-cmd --reload"); + if (String.Equals(openFireWallPort, "443")) + { + client.RunCommand("firewall-cmd --zone=public --add-port=80/tcp --permanent"); + client.RunCommand("firewall-cmd --zone=public --add-port=443/tcp --permanent"); + client.RunCommand("firewall-cmd --reload"); + } + else + { + client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/tcp --permanent"); + client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/udp --permanent"); + client.RunCommand("firewall-cmd --reload"); + } } - else + if (String.IsNullOrEmpty(client.RunCommand("command -v ufw").Result) == false) { - client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/tcp --permanent"); - client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/udp --permanent"); - client.RunCommand("firewall-cmd --reload"); + 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 @@ -696,7 +722,12 @@ 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(); diff --git a/ProxySU/ResultClientInformation.xaml b/ProxySU/ResultClientInformation.xaml index b0a914c..7b1abe8 100644 --- a/ProxySU/ResultClientInformation.xaml +++ b/ProxySU/ResultClientInformation.xaml @@ -61,9 +61,12 @@ + + + - - + + diff --git a/ProxySU/ResultClientInformation.xaml.cs b/ProxySU/ResultClientInformation.xaml.cs index 3849a0f..f43812d 100644 --- a/ProxySU/ResultClientInformation.xaml.cs +++ b/ProxySU/ResultClientInformation.xaml.cs @@ -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["host"] = ""; - v2rayNjsonObject["path"] = TextBoxPath.Text.ToString(); //设置路径 - v2rayNjsonObject["tls"] = TextBoxTLS.Text.ToString(); //设置是否启用TLS + 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["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); diff --git a/ProxySU/TemplateConfiguration.xaml b/ProxySU/TemplateConfiguration.xaml index ddade1b..5944cce 100644 --- a/ProxySU/TemplateConfiguration.xaml +++ b/ProxySU/TemplateConfiguration.xaml @@ -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"> @@ -20,6 +20,7 @@ + @@ -33,31 +34,51 @@ + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,10 +104,10 @@ - - - - + + + + diff --git a/ProxySU/TemplateConfiguration.xaml.cs b/ProxySU/TemplateConfiguration.xaml.cs index ec43979..4c9668b 100644 --- a/ProxySU/TemplateConfiguration.xaml.cs +++ b/ProxySU/TemplateConfiguration.xaml.cs @@ -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 { } + + + + } } diff --git a/ProxySU/bin/Release/TemplateConfg/quic_client_config.json b/ProxySU/bin/Release/TemplateConfg/quic_client_config.json new file mode 100644 index 0000000..b532a1b --- /dev/null +++ b/ProxySU/bin/Release/TemplateConfg/quic_client_config.json @@ -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 + } + } + } + } + ] +} \ No newline at end of file diff --git a/ProxySU/bin/Release/TemplateConfg/quic_server_config.json b/ProxySU/bin/Release/TemplateConfg/quic_server_config.json new file mode 100644 index 0000000..2c6e66d --- /dev/null +++ b/ProxySU/bin/Release/TemplateConfg/quic_server_config.json @@ -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": {} + } + ] +}