diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index d762a5d..c32ebd4 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 - v2.2.3" Height="675" Width="620"> + Title="ProxySU - v2.3.0" Height="675" Width="620"> @@ -204,19 +204,34 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -574,6 +589,7 @@ + diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index 2fc123a..c7a1cbb 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -45,10 +45,10 @@ namespace ProxySU //ReceiveConfigurationParameters[0]----模板类型 //ReceiveConfigurationParameters[1]----服务端口 //ReceiveConfigurationParameters[2]----V2Ray uuid/(naive/Trojan-go/Trojan/SSR/SS)' Password - //ReceiveConfigurationParameters[3]----Websocket'Path/http2'Path/naive'user + //ReceiveConfigurationParameters[3]----QUIC加密方式/SSR 加密方法/naive'user //ReceiveConfigurationParameters[4]----Domain //ReceiveConfigurationParameters[5]----伪装类型/插件名称 - //ReceiveConfigurationParameters[6]----QUIC密钥/mKCP Seed/SS 加密方式 + //ReceiveConfigurationParameters[6]----Websocket'Path/http2'Path/QUIC密钥/mKCP Seed/SS 加密方式 //ReceiveConfigurationParameters[7]----伪装网站 //ReceiveConfigurationParameters[8]----方案名称 //ReceiveConfigurationParameters[9]----插件参数选项 @@ -113,6 +113,9 @@ namespace ProxySU //初始化SSR的密码 TextBoxSSRPassword.Text = RandomUUID(); + //初始化所选方案面板为不显示 + GridV2rayCurrentlyPlan.Visibility = Visibility.Hidden; + //初始化三合一的所有内容 //TextBoxV2rayUUID3in1.Text = RandomUUID(); //TextBoxV2rayPath3in1.Text = "/ray"; @@ -698,152 +701,202 @@ namespace ProxySU //显示"未选择方案!" TextBlockCurrentlySelectedPlan.Text = Application.Current.FindResource("TextBlockCurrentlySelectedPlanNo").ToString(); - TextBlockV2RayShowPort.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Hidden; + GridV2rayCurrentlyPlan.Visibility = Visibility.Hidden; - TextBlockV2RayShowUUID.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Hidden; - - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; return; } + else + { + GridV2rayCurrentlyPlan.Visibility = Visibility.Visible; + } TextBlockCurrentlySelectedPlan.Text = ReceiveConfigurationParameters[8]; //所选方案名称 TextBlockCurrentlySelectedPlanPort.Text = ReceiveConfigurationParameters[1]; //服务器端口 TextBlockCurrentlySelectedPlanUUID.Text = ReceiveConfigurationParameters[2]; //UUID TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path - TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[4]; //域名 + TextBlockCurrentlySelectedPlanFakeWebsite.Text = ReceiveConfigurationParameters[7]; //伪装网站 - if (String.Equals(ReceiveConfigurationParameters[0],"TCP") - || String.Equals(ReceiveConfigurationParameters[0], "TCPhttp") - || String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned") - || String.Equals(ReceiveConfigurationParameters[0], "webSocket")) + if (String.Equals(ReceiveConfigurationParameters[0],"TCP") == true + || String.Equals(ReceiveConfigurationParameters[0], "TCPhttp") == true + || String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned") == true + || String.Equals(ReceiveConfigurationParameters[0], "webSocket") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; + //隐藏Path/mKCP Seed/Quic Key + HideV2RayPathSeedKey(); - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; + //隐藏域名/Quic加密方式 + HideV2RayDomainQuicEncrypt(); - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //隐藏伪装网站 + HideV2RayMaskSites(); } - else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS") || String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb")) + else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; + //隐藏Path/mKCP Seed/Quic Key + HideV2RayPathSeedKey(); - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; + //显示域名 + ShowV2RayDomainQuicEncrypt(); + TextBlockV2RayShowCurrentlySelectedPlanDomain.Text = Application.Current.FindResource("TextBlockV2RayDomain").ToString(); + TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[4]; //域名 - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Hidden; - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; - - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //隐藏伪装网站 + HideV2RayMaskSites(); } - else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") - || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") - || String.Equals(ReceiveConfigurationParameters[0], "Http2") - || String.Equals(ReceiveConfigurationParameters[0], "http2Web")) + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; + //隐藏Path/mKCP Seed/Quic Key + HideV2RayPathSeedKey(); - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; + //显示域名 + ShowV2RayDomainQuicEncrypt(); + TextBlockV2RayShowCurrentlySelectedPlanDomain.Text = Application.Current.FindResource("TextBlockV2RayDomain").ToString(); + TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[4]; //域名 + + //显示伪装网站(暂时不显示) + ShowV2RayMaskSites(); + } + else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true + || String.Equals(ReceiveConfigurationParameters[0], "Http2") == true) + { + //显示Path + ShowV2RayPathSeedKey(); TextBlockV2RayShowPathSeedKey.Text = "Path:"; - TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[3]; //mKCP Seed\Quic Key\Path + TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Visible; - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; + //显示域名 + ShowV2RayDomainQuicEncrypt(); + TextBlockV2RayShowCurrentlySelectedPlanDomain.Text = Application.Current.FindResource("TextBlockV2RayDomain").ToString(); + TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[4]; //域名 - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //显示伪装网站(暂时不显示) + HideV2RayMaskSites(); } - else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned")) + else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; - - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; - + //显示Path + ShowV2RayPathSeedKey(); TextBlockV2RayShowPathSeedKey.Text = "Path:"; - TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[3]; //mKCP Seed\Quic Key\Path + TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Visible; + //显示域名 + ShowV2RayDomainQuicEncrypt(); + TextBlockV2RayShowCurrentlySelectedPlanDomain.Text = Application.Current.FindResource("TextBlockV2RayDomain").ToString(); + TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[4]; //域名 - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //显示伪装网站(暂时不显示) + ShowV2RayMaskSites(); } - else if (ReceiveConfigurationParameters[0].Contains("mKCP")) + else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") == true + || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned") == true) + { + //显示Path + ShowV2RayPathSeedKey(); + TextBlockV2RayShowPathSeedKey.Text = "Path:"; + TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path + + //隐藏域名/Quic加密方式 + HideV2RayDomainQuicEncrypt(); + + //隐藏伪装网站 + HideV2RayMaskSites(); + } + else if (ReceiveConfigurationParameters[0].Contains("mKCP") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; - - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; - + //显示mKCP Seed + ShowV2RayPathSeedKey(); TextBlockV2RayShowPathSeedKey.Text = "mKCP Seed:"; TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Visible; + //隐藏域名/Quic加密方式 + HideV2RayDomainQuicEncrypt(); - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //隐藏伪装网站 + HideV2RayMaskSites(); } - else if (ReceiveConfigurationParameters[0].Contains("Quic")) + else if (ReceiveConfigurationParameters[0].Contains("Quic") == true) { - TextBlockV2RayShowPort.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; - - TextBlockV2RayShowUUID.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; - + //显示QUIC Key + ShowV2RayPathSeedKey(); TextBlockV2RayShowPathSeedKey.Text = "QUIC Key:"; TextBlockCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path - TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Visible; - TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Visible; + //显示Quic加密方式 + ShowV2RayDomainQuicEncrypt(); + TextBlockV2RayShowCurrentlySelectedPlanDomain.Text = Application.Current.FindResource("TextBlockQuicEncryption").ToString(); + TextBlockCurrentlySelectedPlanDomain.Text = ReceiveConfigurationParameters[3]; //Quic加密方式 + if (String.Equals(TextBlockCurrentlySelectedPlanDomain.Text,"none")==true) + { + HideV2RayPathSeedKey(); + } - TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; - TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; - TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + //隐藏伪装网站 + HideV2RayMaskSites(); } } + #region 当前方案界面控制 + //显示端口与UUID + private void ShowV2RayCurrentPortUUID() + { + TextBlockV2RayShowPort.Visibility = Visibility.Visible; + TextBlockCurrentlySelectedPlanPort.Visibility = Visibility.Visible; + + TextBlockV2RayShowUUID.Visibility = Visibility.Visible; + TextBlockCurrentlySelectedPlanUUID.Visibility = Visibility.Visible; + } + + //显示Path/mKCP Seed/Quic Key + private void ShowV2RayPathSeedKey() + { + TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Visible; + TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Visible; + } + + //隐藏Path/mKCP Seed/Quic Key + private void HideV2RayPathSeedKey() + { + TextBlockV2RayShowPathSeedKey.Visibility = Visibility.Hidden; + TextBlockCurrentlySelectedPlanPathSeedKey.Visibility = Visibility.Hidden; + } + + //显示域名/Quic加密方式 + private void ShowV2RayDomainQuicEncrypt() + { + TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; + TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Visible; + } + + //隐藏域名/Quic加密方式 + private void HideV2RayDomainQuicEncrypt() + { + TextBlockV2RayShowCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; + TextBlockCurrentlySelectedPlanDomain.Visibility = Visibility.Hidden; + } + //显示伪装网站(暂时不显示) + private void ShowV2RayMaskSites() + { + TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + } + + //隐藏伪装网站 + private void HideV2RayMaskSites() + { + TextBlockV2RayShowCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + TextBlockCurrentlySelectedPlanFakeWebsite.Visibility = Visibility.Hidden; + } + #endregion + //传送V2Ray模板参数,启动V2Ray安装进程 private void Button_Login_Click(object sender, RoutedEventArgs e) @@ -1700,89 +1753,73 @@ namespace ProxySU if (String.Equals(ReceiveConfigurationParameters[0], "TCP")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\tcp_server_config.json"; - //serverConfig = "TemplateConfg\\tcp_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "TCPhttp")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\tcp_http_server_config.json"; - //serverConfig = "TemplateConfg\\tcp_http_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_http_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\tcp_TLS_server_config.json"; - //serverConfig = "TemplateConfg\\tcp_TLS_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_TLS_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\tcpTLSselfSigned_server_config.json"; - //serverConfig = "TemplateConfg\\tcpTLSselfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\tcpTLSselfSigned_client_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp")) + { + inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\vless_tcp_xtls_server_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb")) { - inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\tcp_vless_tls_caddy_server_config.json"; - //serverConfig = "TemplateConfg\\tcp_vless_tls_caddy_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_vless_tls_caddy_cilent_config.json"; + inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\vless_tcp_tls_server_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb")) + { + inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\vless_ws_tls_server_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web")) + { + inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\vless_http2_tls_server_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "webSocket")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\webSocket_server_config.json"; - //serverConfig = "TemplateConfg\\webSocket_server_config.json"; - //clientConfig = "TemplateConfg\\webSocket_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\WebSocket_TLS_server_config.json"; - //serverConfig = "TemplateConfg\\WebSocket_TLS_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocket_TLS_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\WebSocketTLS_selfSigned_server_config.json"; - //serverConfig = "TemplateConfg\\WebSocketTLS_selfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocketTLS_selfSigned_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\WebSocketTLSWeb_server_config.json"; - //serverConfig = "TemplateConfg\\WebSocketTLSWeb_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocketTLSWeb_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "Http2")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\http2_server_config.json"; - //serverConfig = "TemplateConfg\\http2_server_config.json"; - //clientConfig = @"TemplateConfg\http2_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "http2Web")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\Http2Web_server_config.json"; - //serverConfig = "TemplateConfg\\Http2Web_server_config.json"; - //clientConfig = "TemplateConfg\\Http2Web_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\Http2selfSigned_server_config.json"; - //serverConfig = "TemplateConfg\\Http2selfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\Http2selfSigned_client_config.json"; } //else if (String.Equals(ReceiveConfigurationParameters[0], "MkcpNone")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2SRTP")||String.Equals(ReceiveConfigurationParameters[0], "mKCPuTP")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WechatVideo")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2DTLS")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WireGuard")) else if (ReceiveConfigurationParameters[0].Contains("mKCP")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\mkcp_server_config.json"; - //serverConfig = "TemplateConfg\\mkcp_server_config.json"; - //clientConfig = "TemplateConfg\\mkcp_client_config.json"; } // 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")) else if (ReceiveConfigurationParameters[0].Contains("Quic")) { inboundsConfigJson = @"TemplateConfg\v2ray\server\05_inbounds\quic_server_config.json"; - //serverConfig = "TemplateConfg\\quic_server_config.json"; - //clientConfig = "TemplateConfg\\quic_client_config.json"; } //读取"inbounds" @@ -1802,21 +1839,27 @@ namespace ProxySU //设置uuid jObjectJson["inbounds"][0]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; - //除WebSocketTLSWeb/http2Web/VlessTcpTlsWeb模式外设置监听端口 + + //除WebSocketTLSWeb/http2Web/VLESS+WebSocket+TLS+Web/VLESS+http2+TLS+Web模式外设置监听端口 if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == false && String.Equals(ReceiveConfigurationParameters[0], "http2Web") == false - && String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == false) + && String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb") == false + && String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == false) { jObjectJson["inbounds"][0]["port"] = int.Parse(ReceiveConfigurationParameters[1]); } - if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true) + + //设置VLESS协议的回落端口,指向Caddy + if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true) { - //设置Caddy随机监听的端口,用于Trojan-go,Trojan,V2Ray vless TLS - //Random random = new Random(); + //设置Caddy随机监听的端口 randomCaddyListenPort = GetRandomPort(); + //指向Caddy监听的随机端口 jObjectJson["inbounds"][0]["settings"]["fallbacks"][0]["dest"] = randomCaddyListenPort; } + //TLS自签证书/WebSocketTLS(自签证书)/http2自签证书模式下,使用v2ctl 生成自签证书 if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") == true || String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned") == true @@ -1826,26 +1869,32 @@ namespace ProxySU JObject selfSignedCaJObject = JObject.Parse(selfSignedCa); jObjectJson["inbounds"][0]["streamSettings"]["tlsSettings"]["certificates"][0] = selfSignedCaJObject; } - //如果是WebSocketTLSWeb/WebSocketTLS/WebSocketTLS(自签证书)模式,则设置路径 + + //如果是WebSocketTLSWeb/WebSocketTLS/WebSocketTLS(自签证书)/VLESS+WebSocket+TLS+Web模式,则设置路径 if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") == true - || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true) + || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb")==true) { - jObjectJson["inbounds"][0]["streamSettings"]["wsSettings"]["path"] = ReceiveConfigurationParameters[3]; + jObjectJson["inbounds"][0]["streamSettings"]["wsSettings"]["path"] = ReceiveConfigurationParameters[6]; } - //如果是Http2/http2Web/http2自签模式下,设置路径 + + //如果是Http2/http2Web/http2自签/VLESS+http2+TLS+Web模式下,设置路径 if (String.Equals(ReceiveConfigurationParameters[0], "Http2") == true || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true - || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned") == true) + || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { - jObjectJson["inbounds"][0]["streamSettings"]["httpSettings"]["path"] = ReceiveConfigurationParameters[3]; + jObjectJson["inbounds"][0]["streamSettings"]["httpSettings"]["path"] = ReceiveConfigurationParameters[6]; } - //如果是Http2Web模式下,设置host - if (String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true) + + //如果是Http2+Web/VLESS+http2+TLS+Web模式下,设置host + if (String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { - // jObjectJson["inbounds"][0]["streamSettings"]["httpSettings"]["path"] = ReceiveConfigurationParameters[3]; jObjectJson["inbounds"][0]["streamSettings"]["httpSettings"]["host"][0] = ReceiveConfigurationParameters[4]; } + //mkcp模式下,设置伪装类型 if (ReceiveConfigurationParameters[0].Contains("mKCP") == true) { @@ -1855,12 +1904,20 @@ namespace ProxySU jObjectJson["inbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6]; } } + //quic模式下设置伪装类型及密钥 if (ReceiveConfigurationParameters[0].Contains("Quic") == true) { jObjectJson["inbounds"][0]["streamSettings"]["quicSettings"]["header"]["type"] = ReceiveConfigurationParameters[5]; + jObjectJson["inbounds"][0]["streamSettings"]["quicSettings"]["security"] = ReceiveConfigurationParameters[3]; + + if (String.Equals(ReceiveConfigurationParameters[3],"none") == true) + { + ReceiveConfigurationParameters[6] = ""; + } jObjectJson["inbounds"][0]["streamSettings"]["quicSettings"]["key"] = ReceiveConfigurationParameters[6]; } + serverJson["inbounds"] = jObjectJson["inbounds"]; } @@ -1874,8 +1931,12 @@ namespace ProxySU File.Delete(@"config.json"); - //如果使用http2/WebSocketTLS/tcpTLS/VlessTcpTlsWeb模式,先要安装acme.sh,申请证书 - if (String.Equals(ReceiveConfigurationParameters[0], "Http2") == true || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true || String.Equals(ReceiveConfigurationParameters[0], "tcpTLS") == true || String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true) + //如果使用http2/WebSocketTLS/tcpTLS/VlessTcpTlsWeb/VLESS+TCP+XTLS+Web模式,先要安装acme.sh,申请证书 + if (String.Equals(ReceiveConfigurationParameters[0], "Http2") == true + || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true + || String.Equals(ReceiveConfigurationParameters[0], "tcpTLS") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true) { //****** "正在安装acme.sh......" ******22 SetUpProgressBarProcessing(55); @@ -2030,10 +2091,13 @@ namespace ProxySU } - //如果是WebSocket+TLS+Web/http2Web/vlessTcpTlsWeb模式,需要安装Caddy - if (ReceiveConfigurationParameters[0].Contains("WebSocketTLS2Web") ==true - || ReceiveConfigurationParameters[0].Contains("http2Web") == true - || ReceiveConfigurationParameters[0].Contains("VlessTcpTlsWeb") == true) + //如果是VLESS+TCP+XTLS+Web/VLESS+TCP+TLS+Web/VLESS+WebSocket+TLS+Web/VLESS+http2+TLS+Web/WebSocket+TLS+Web/http2Web模式,需要安装Caddy + if (String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true + || String.Equals(ReceiveConfigurationParameters[0],"WebSocketTLS2Web") ==true + || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true) { //****** "安装Caddy......" ******28 SetUpProgressBarProcessing(70); @@ -2155,7 +2219,8 @@ namespace ProxySU TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandResult);//显示命令执行的结果 //在Caddy 2还未推出2.2.0的正式版之前,先用测试版替代 - if (String.Equals(ReceiveConfigurationParameters[0], "http2Web")) + if (String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { //****** "正在为Http2Web模式升级Caddy v2.2.0测试版!" ******30 SetUpProgressBarProcessing(77); @@ -2211,18 +2276,22 @@ namespace ProxySU currentShellCommandResult = client.RunCommand(sshShellCommand).Result; TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandResult);//显示命令执行的结果 - if (ReceiveConfigurationParameters[0].Contains("WebSocketTLS2Web") == true) - { - serverConfig = @"TemplateConfg\v2ray\caddy\WebSocketTLSWeb.caddyfile"; - } - else if (ReceiveConfigurationParameters[0].Contains("http2Web") == true) - { - serverConfig = @"TemplateConfg\v2ray\caddy\Http2Web.caddyfile"; - } - else if(ReceiveConfigurationParameters[0].Contains("VlessTcpTlsWeb")==true) + if (String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true) { serverConfig = @"TemplateConfg\v2ray\caddy\vlessTcpTlsWeb.caddyfile"; } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb") == true + || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true) + { + serverConfig = @"TemplateConfg\v2ray\caddy\WebSocketTLSWeb.caddyfile"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true) + { + serverConfig = @"TemplateConfg\v2ray\caddy\Http2Web.caddyfile"; + } + string upLoadPath = "/etc/caddy/Caddyfile"; client.RunCommand("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.bak"); UploadConfig(connectionInfo, serverConfig, upLoadPath); @@ -2244,7 +2313,7 @@ namespace ProxySU TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandResult);//显示命令执行的结果 //设置Path - sshShellCommand = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[3]}/' {upLoadPath}"; + sshShellCommand = $"sed -i 's/##path##/\\{ReceiveConfigurationParameters[6]}/' {upLoadPath}"; TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, sshShellCommand);//显示执行的命令 currentShellCommandResult = client.RunCommand(sshShellCommand).Result; TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandResult);//显示命令执行的结果 @@ -2616,117 +2685,120 @@ namespace ProxySU clientJson["reverse"] = jObjectJson["reverse"]; } + //根据选择的不同模式,选择相应的配置文件 if (String.Equals(ReceiveConfigurationParameters[0], "TCP")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\tcp_client_config.json"; - //serverConfig = "TemplateConfg\\tcp_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "TCPhttp")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\tcp_http_client_config.json"; - //serverConfig = "TemplateConfg\\tcp_http_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_http_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\tcp_TLS_client_config.json"; - //serverConfig = "TemplateConfg\\tcp_TLS_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_TLS_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\tcpTLSselfSigned_client_config.json"; - //serverConfig = "TemplateConfg\\tcpTLSselfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\tcpTLSselfSigned_client_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp")) + { + outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_xtls_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb")) { - outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\tcp_vless_tls_caddy_cilent_config.json"; - //serverConfig = "TemplateConfg\\tcp_vless_tls_caddy_server_config.json"; - //clientConfig = "TemplateConfg\\tcp_vless_tls_caddy_cilent_config.json"; + outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_tls_caddy_cilent_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb")) + { + outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\vless_ws_tls_client_config.json"; + } + else if (String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web")) + { + outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\vless_http2_tls_server_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "webSocket")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\webSocket_client_config.json"; - //serverConfig = "TemplateConfg\\webSocket_server_config.json"; - //clientConfig = "TemplateConfg\\webSocket_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\WebSocket_TLS_client_config.json"; - //serverConfig = "TemplateConfg\\WebSocket_TLS_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocket_TLS_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\WebSocketTLS_selfSigned_client_config.json"; - //serverConfig = "TemplateConfg\\WebSocketTLS_selfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocketTLS_selfSigned_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\WebSocketTLSWeb_client_config.json"; - //serverConfig = "TemplateConfg\\WebSocketTLSWeb_server_config.json"; - //clientConfig = "TemplateConfg\\WebSocketTLSWeb_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "Http2")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\http2_client_config.json"; - //serverConfig = "TemplateConfg\\http2_server_config.json"; - //clientConfig = @"TemplateConfg\http2_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "http2Web")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\Http2Web_client_config.json"; - //serverConfig = "TemplateConfg\\Http2Web_server_config.json"; - //clientConfig = "TemplateConfg\\Http2Web_client_config.json"; } else if (String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\Http2selfSigned_client_config.json"; - //serverConfig = "TemplateConfg\\Http2selfSigned_server_config.json"; - //clientConfig = "TemplateConfg\\Http2selfSigned_client_config.json"; } //else if (String.Equals(ReceiveConfigurationParameters[0], "MkcpNone")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2SRTP")||String.Equals(ReceiveConfigurationParameters[0], "mKCPuTP")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WechatVideo")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2DTLS")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WireGuard")) else if (ReceiveConfigurationParameters[0].Contains("mKCP")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\mkcp_client_config.json"; - //serverConfig = "TemplateConfg\\mkcp_server_config.json"; - //clientConfig = "TemplateConfg\\mkcp_client_config.json"; } - // 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")) else if (ReceiveConfigurationParameters[0].Contains("Quic")) { outboundsConfigJson = @"TemplateConfg\v2ray\client\06_outbounds\quic_client_config.json"; - //serverConfig = "TemplateConfg\\quic_server_config.json"; - //clientConfig = "TemplateConfg\\quic_client_config.json"; } //读取"相应模板的outbounds" using (StreamReader readerJson = File.OpenText(outboundsConfigJson)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); + //设置客户端的地址/端口/id jObjectJson["outbounds"][0]["settings"]["vnext"][0]["address"] = ReceiveConfigurationParameters[4]; jObjectJson["outbounds"][0]["settings"]["vnext"][0]["port"] = int.Parse(ReceiveConfigurationParameters[1]); jObjectJson["outbounds"][0]["settings"]["vnext"][0]["users"][0]["id"] = ReceiveConfigurationParameters[2]; - //设置WebSocket系统模式下的path - if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") == true || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true) + + //设置WebSocket模式下的path + if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS") == true + || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned") == true + || String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb") == true) { - jObjectJson["outbounds"][0]["streamSettings"]["wsSettings"]["path"] = ReceiveConfigurationParameters[3]; + jObjectJson["outbounds"][0]["streamSettings"]["wsSettings"]["path"] = ReceiveConfigurationParameters[6]; } + //设置http2模式下的path - if (String.Equals(ReceiveConfigurationParameters[0], "Http2") == true || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned") == true) + if (String.Equals(ReceiveConfigurationParameters[0], "Http2") == true + || String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { - jObjectJson["outbounds"][0]["streamSettings"]["httpSettings"]["path"] = ReceiveConfigurationParameters[3]; + jObjectJson["outbounds"][0]["streamSettings"]["httpSettings"]["path"] = ReceiveConfigurationParameters[6]; } - //设置http2web模式下的host - if (String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true) + + //设置http2+TLS+Web/VLESS+http2+TLS+Web模式下的host + if (String.Equals(ReceiveConfigurationParameters[0], "http2Web") == true + || String.Equals(ReceiveConfigurationParameters[0], "VlessHttp2Web") == true) { jObjectJson["outbounds"][0]["streamSettings"]["httpSettings"]["host"][0] = ReceiveConfigurationParameters[4]; } + + //设置VLESS+TCP+XTLS+Web模式下的serverName + if (String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true) + { + jObjectJson["outbounds"][0]["streamSettings"]["xtlsSettings"]["serverName"] = ReceiveConfigurationParameters[4]; + } + + //设置mkcp if (ReceiveConfigurationParameters[0].Contains("mKCP") == true) { jObjectJson["outbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5]; @@ -2735,9 +2807,16 @@ namespace ProxySU jObjectJson["outbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6]; } } + + //设置QUIC if (ReceiveConfigurationParameters[0].Contains("Quic") == true) { jObjectJson["outbounds"][0]["streamSettings"]["quicSettings"]["header"]["type"] = ReceiveConfigurationParameters[5]; + jObjectJson["inbounds"][0]["streamSettings"]["quicSettings"]["security"] = ReceiveConfigurationParameters[3]; + if (String.Equals(ReceiveConfigurationParameters[3], "none") == true) + { + ReceiveConfigurationParameters[6] = ""; + } jObjectJson["outbounds"][0]["streamSettings"]["quicSettings"]["key"] = ReceiveConfigurationParameters[6]; } @@ -12153,12 +12232,19 @@ namespace ProxySU MessageBox.Show(ex.Message); } } - #endregion - // #region 三合一安装过程 + private void Button_Click(object sender, RoutedEventArgs e) + { + //显示服务端连接参数 + proxyType = "V2Ray"; + ResultClientInformation resultClientInformation = new ResultClientInformation(); + resultClientInformation.ShowDialog(); + } + + #region 三合一安装过程 // //生成三合一的v2ray路径 // private void ButtonV2rayPath3in1_Click(object sender, RoutedEventArgs e) @@ -13141,7 +13227,7 @@ namespace ProxySU // } - // #endregion + #endregion } diff --git a/ProxySU/Properties/AssemblyInfo.cs b/ProxySU/Properties/AssemblyInfo.cs index 16d0827..6c62c37 100644 --- a/ProxySU/Properties/AssemblyInfo.cs +++ b/ProxySU/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.2.3.0")] -[assembly: AssemblyFileVersion("2.2.3.0")] +[assembly: AssemblyVersion("2.3.0.0")] +[assembly: AssemblyFileVersion("2.3.0.0")] diff --git a/ProxySU/ResultClientInformation.xaml b/ProxySU/ResultClientInformation.xaml index a3e4ac7..364a1bd 100644 --- a/ProxySU/ResultClientInformation.xaml +++ b/ProxySU/ResultClientInformation.xaml @@ -13,18 +13,18 @@ - + - + - + @@ -34,39 +34,48 @@ - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,7 +138,7 @@ - + diff --git a/ProxySU/ResultClientInformation.xaml.cs b/ProxySU/ResultClientInformation.xaml.cs index 7484e5c..3403009 100644 --- a/ProxySU/ResultClientInformation.xaml.cs +++ b/ProxySU/ResultClientInformation.xaml.cs @@ -53,68 +53,111 @@ namespace ProxySU TextBoxUUIDextra.Text = "16"; //加密方式,一般都为auto TextBoxEncryption.Text = "auto"; + //传输协议 TextBoxTransmission.Text = ""; //伪装类型 TextBoxCamouflageType.Text = MainWindow.ReceiveConfigurationParameters[5]; + + //TLS的Host /Quic 加密方式 + TextBoxHostQuicEncryption.Text = ""; + + //QUIC密钥/mKCP Seed/路径Path + TextBoxQuicKeyMkcpSeedPath.Text = MainWindow.ReceiveConfigurationParameters[6]; + //是否启用TLS TextBoxTLS.Text = "none"; - //TLS的Host - TextBoxHost.Text = ""; - //路径Path - TextBoxPath.Text = MainWindow.ReceiveConfigurationParameters[3]; - //QUIC密钥/mKCP Seed - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS2Web")) - { - TextBoxTransmission.Text = "ws"; //传输协议 - TextBoxCamouflageType.Text = "none"; //伪装类型 - TextBoxTLS.Text = "tls"; //是否启用TLS - ShowPath(); //显示路径 - HideQuicKey(); //隐藏Quic\mKCP密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCP")) + if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCP")) { TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "none"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); + } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCPhttp")) { TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "http"; TextBoxTLS.Text = "none"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "tcpTLS")) { TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "tcpTLSselfSigned")) { TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessTcpTlsWeb")) + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessXtlsTcp")) { + TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "none"; TextBoxEncryption.Text = "none"; TextBoxTLS.Text = "tls"; HideAlterId(); - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); + //TextBlockQrURLexplain.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + ImageShareQRcode.Visibility = Visibility.Collapsed; + TextBoxURL.Visibility = Visibility.Collapsed; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessTcpTlsWeb")) + { + TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + + TextBoxTransmission.Text = "tcp"; + TextBoxCamouflageType.Text = "none"; + TextBoxEncryption.Text = "none"; + TextBoxTLS.Text = "tls"; + HideAlterId(); + ShowHostName(); + ShowPathV2ray(); + //TextBlockQrURLexplain.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + ImageShareQRcode.Visibility = Visibility.Collapsed; + TextBoxURL.Visibility = Visibility.Collapsed; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessWebSocketTlsWeb")) + { + TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + + TextBoxTransmission.Text = "ws"; + TextBoxCamouflageType.Text = "none"; + TextBoxEncryption.Text = "none"; + TextBoxTLS.Text = "tls"; + HideAlterId(); + ShowHostName(); + ShowPathV2ray(); + //TextBlockQrURLexplain.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + ImageShareQRcode.Visibility = Visibility.Collapsed; + TextBoxURL.Visibility = Visibility.Collapsed; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessHttp2Web")) + { + TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); + + TextBoxTransmission.Text = "h2"; + TextBoxCamouflageType.Text = "none"; + TextBoxEncryption.Text = "none"; + TextBoxTLS.Text = "tls"; + HideAlterId(); + ShowHostName(); + ShowPathV2ray(); + //TextBlockQrURLexplain.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); ImageShareQRcode.Visibility = Visibility.Collapsed; TextBoxURL.Visibility = Visibility.Collapsed; } @@ -123,157 +166,125 @@ namespace ProxySU TextBoxTransmission.Text = "ws"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "none"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS")) { TextBoxTransmission.Text = "ws"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - ShowPath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS2Web")) + { + TextBoxTransmission.Text = "ws"; + TextBoxCamouflageType.Text = "none"; + TextBoxTLS.Text = "tls"; + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned")) { TextBoxTransmission.Text = "ws"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - ShowPath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Http2")) { TextBoxTransmission.Text = "h2"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - ShowPath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "http2Web")) { TextBoxTransmission.Text = "h2"; TextBoxCamouflageType.Text = "none"; - TextBoxHost.Text = MainWindow.ReceiveConfigurationParameters[4]; + TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];//获取Host TextBoxTLS.Text = "tls"; - ShowPath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "http2selfSigned")) { TextBoxTransmission.Text = "h2"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "tls"; - ShowPath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPNone")) + else if (MainWindow.ReceiveConfigurationParameters[0].Contains("mKCP")) { + if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPNone")) + { + TextBoxCamouflageType.Text = "none"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP")) + { + TextBoxCamouflageType.Text = "srtp"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP")) + { + TextBoxCamouflageType.Text = "utp"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo")) + { + TextBoxCamouflageType.Text = "wechat-video"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS")) + { + TextBoxCamouflageType.Text = "dtls"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard")) + { + TextBoxCamouflageType.Text = "wireguard"; + } + TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "none"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; + TextBoxQuicKeyMkcpSeedPath.Text = MainWindow.ReceiveConfigurationParameters[6];//获取mkcp Seed TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed + ShowHostName(); + ShowMkcpSeed(); } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP")) - { - TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "srtp"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP")) - { - TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "utp"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo")) - { - TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "wechat-video"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS")) - { - TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "dtls"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard")) - { - TextBoxTransmission.Text = "kcp"; - TextBoxCamouflageType.Text = "wireguard"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示mKCP Seed - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone")) + else if (MainWindow.ReceiveConfigurationParameters[0].Contains("Quic") == true) { + if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone")) + { + TextBoxCamouflageType.Text = "none"; + + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicSRTP")) + { + TextBoxCamouflageType.Text = "srtp"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Quic2uTP")) + { + TextBoxCamouflageType.Text = "utp"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWechatVideo")) + { + TextBoxCamouflageType.Text = "wechat-video"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicDTLS")) + { + TextBoxCamouflageType.Text = "dtls"; + } + else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWireGuard")) + { + TextBoxCamouflageType.Text = "wireguard"; + } + TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "none"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; + TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[3];//获取Quic加密方式 + TextBoxQuicKeyMkcpSeedPath.Text = MainWindow.ReceiveConfigurationParameters[6];//获取Quic加密密钥 TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicSRTP")) - { - TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "srtp"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Quic2uTP")) - { - TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "utp"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWechatVideo")) - { - TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "wechat-video"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicDTLS")) - { - TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "dtls"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 - } - else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWireGuard")) - { - TextBoxTransmission.Text = "quic"; - TextBoxCamouflageType.Text = "wireguard"; - TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6]; - TextBoxTLS.Text = "none"; - HidePath(); - ShowQuicKey();//显示QUIC密钥 + ShowQuicEncryption(); + ShowQuicKey(); } else @@ -281,8 +292,8 @@ namespace ProxySU TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "none"; TextBoxTLS.Text = "none"; - HidePath(); - HideQuicKey(); + ShowHostName(); + ShowPathV2ray(); } CheckDir("v2ray_config"); @@ -492,27 +503,46 @@ namespace ProxySU } #region 界面控制相关 - private void HidePath() + + //显示Quic 加密方式 + private void ShowQuicEncryption() { - TextBlockPath.Visibility = Visibility.Collapsed; - TextBoxPath.Visibility = Visibility.Collapsed; - TextBlockPathExplain.Visibility = Visibility.Collapsed; - + TextBlockQuicEncryption.Visibility = Visibility.Visible; + TextBlockHost.Visibility = Visibility.Collapsed; } - private void ShowPath() + + //显示Host隐藏Quic加密方式 + private void ShowHostName() + { + TextBlockHost.Visibility = Visibility.Visible; + TextBlockQuicEncryption.Visibility = Visibility.Collapsed; + } + + //显示路径Path,隐藏mKCP/Quic Key/复制按钮 + private void ShowPathV2ray() { TextBlockPath.Visibility = Visibility.Visible; - TextBoxPath.Visibility = Visibility.Visible; - TextBlockPathExplain.Visibility = Visibility.Visible; - - } - private void HideQuicKey() - { + TextBlockMkcpSeed.Visibility = Visibility.Collapsed; TextBlockQuicKey.Visibility = Visibility.Collapsed; - TextBoxQuicKey.Visibility = Visibility.Collapsed; - TextBlockQuicKeyExplain.Visibility = Visibility.Collapsed; - } + + //显示mKCP Seed/复制按钮,隐藏Path/Quic Key + private void ShowMkcpSeed() + { + TextBlockPath.Visibility = Visibility.Collapsed; + TextBlockMkcpSeed.Visibility = Visibility.Visible; + TextBlockQuicKey.Visibility = Visibility.Collapsed; + } + + //显示Quic Key/复制按钮 隐藏Path/mKcp Seed + private void ShowQuicKey() + { + TextBlockPath.Visibility = Visibility.Collapsed; + TextBlockMkcpSeed.Visibility = Visibility.Collapsed; + TextBlockQuicKey.Visibility = Visibility.Visible; + } + + //显示额外ID private void ShowAlterId() { TextBlockUUIDextra.Visibility = Visibility.Visible; @@ -520,6 +550,8 @@ namespace ProxySU TextBlockUUIDextraExplanation.Visibility = Visibility.Visible; } + + //隐藏额外ID private void HideAlterId() { TextBlockUUIDextra.Visibility = Visibility.Collapsed; @@ -527,15 +559,109 @@ namespace ProxySU TextBlockUUIDextraExplanation.Visibility = Visibility.Collapsed; } - private void ShowQuicKey() - { - TextBlockQuicKey.Visibility = Visibility.Visible; - TextBoxQuicKey.Visibility = Visibility.Visible; - TextBlockQuicKeyExplain.Visibility = Visibility.Visible; - } + + //private void HidePath() + //{ + // TextBlockPath.Visibility = Visibility.Collapsed; + // TextBoxQuicKeyMkcpSeedPath.Visibility = Visibility.Collapsed; + //} + //private void ShowPath() + //{ + // TextBlockPath.Visibility = Visibility.Visible; + // TextBoxQuicKeyMkcpSeedPath.Visibility = Visibility.Visible; + + //} + //private void HideQuicKey() + //{ + // TextBlockQuicKey.Visibility = Visibility.Collapsed; + // TextBoxQuicKeyMkcpSeedPath.Visibility = Visibility.Collapsed; + //} + + //private void ShowQuicKey() + //{ + // TextBlockQuicKey.Visibility = Visibility.Visible; + // TextBoxQuicKeyMkcpSeedPath.Visibility = Visibility.Visible; + //} #endregion - + + #region 复制参数到剪贴板中 + + //复制内容到剪贴板函数 + private void CopyToClipboard(string content) + { + if (content != "") + { + Clipboard.SetDataObject(content); + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_V2RayUUIDcopyedToClip").ToString()); + } + else + { + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_V2RayEmptyToClip").ToString()); + } + } + + //复制服务器地址到剪贴板 + private void TextBoxHostAddress_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxHostAddress.Text); + } + + + //复制服务器端口到剪贴板 + private void TextBoxPort_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxPort.Text); + } + + //复制UUID到剪贴板 + private void TextBoxUUID_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxUUID.Text); + } + + //复制额外ID到剪贴板 + private void TextBoxUUIDextra_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxUUIDextra.Text); + } + + //复制加密方式到剪贴板 + private void TextBoxEncryption_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxEncryption.Text); + } + + //复制传输协议到剪贴板 + private void TextBoxTransmission_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxTransmission.Text); + } + + //复制伪装方式到剪贴板 + private void TextBoxCamouflageType_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxCamouflageType.Text); + } + + //复制Host/Quic加密方法到剪贴板 + private void TextBoxHostQuicEncryption_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxHostQuicEncryption.Text); + } + + private void TextBoxQuicKeyMkcpSeedPath_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxQuicKeyMkcpSeedPath.Text); + } + + private void TextBoxTLS_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxTLS.Text); + } + + #endregion + //生成v2rayN客户端导入文件 private void GenerateV2rayShareQRcodeAndBase64Url() { @@ -566,17 +692,17 @@ namespace ProxySU if (TextBoxTransmission.Text.Contains("kcp") == true) { - v2rayNjsonObject["path"] = TextBoxQuicKey.Text;//设置mKCP Seed + v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置mKCP Seed } else if (TextBoxTransmission.Text.Contains("quic")==true) { - v2rayNjsonObject["path"] = TextBoxQuicKey.Text;//设置quic密钥 - v2rayNjsonObject["host"] = "chacha20-poly1305"; + v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置quic密钥 + v2rayNjsonObject["host"] = TextBoxHostQuicEncryption.Text;//Quic加密方式 } else { - v2rayNjsonObject["path"] = TextBoxPath.Text; //设置路径 - v2rayNjsonObject["host"] = TextBoxHost.Text;//设置TLS的Host + v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text; //设置路径 + v2rayNjsonObject["host"] = TextBoxHostQuicEncryption.Text;//设置TLS的Host } v2rayNjsonObject["tls"] = TextBoxTLS.Text; //设置是否启用TLS @@ -670,8 +796,8 @@ namespace ProxySU sw.WriteLine(Application.Current.FindResource("TextBlockCamouflageType").ToString() + $"{TextBoxCamouflageType.Text}"); sw.WriteLine(Application.Current.FindResource("TextBlockIsOrNotTLS").ToString() + $"{TextBoxTLS.Text}"); sw.WriteLine("host:" + $"{TextBoxHostAddress.Text}"); - sw.WriteLine(Application.Current.FindResource("TextBlockClientPath").ToString() + $"{TextBoxPath.Text}"); - sw.WriteLine(Application.Current.FindResource("TextBlockClientMkcpQuicKey").ToString() + $"{TextBoxQuicKey.Text}"); + sw.WriteLine(Application.Current.FindResource("TextBlockClientPath").ToString() + $"{TextBoxQuicKeyMkcpSeedPath.Text}"); + sw.WriteLine(Application.Current.FindResource("TextBlockClientMkcpQuicKey").ToString() + $"{TextBoxQuicKeyMkcpSeedPath.Text}"); } @@ -1435,7 +1561,8 @@ namespace ProxySU GroupBoxClientSSpc.Visibility = Visibility.Visible; } + } - + } diff --git a/ProxySU/SSpluginWindow.xaml.cs b/ProxySU/SSpluginWindow.xaml.cs index a7d52fe..70eb2c3 100644 --- a/ProxySU/SSpluginWindow.xaml.cs +++ b/ProxySU/SSpluginWindow.xaml.cs @@ -18,7 +18,7 @@ namespace ProxySU /// public partial class SSpluginWindow : Window { - + //SS加密方法设定 public class EncryptionMethodInfo { public string Name { get; set; } @@ -144,12 +144,6 @@ namespace ProxySU //V2Ray-Plugin SS+WebSocket+TLS+Web模式被选中 else if (RadioButtonWebSocketTLSWebFrontSS.IsChecked == true || RadioButtonWebSocketTLSWebFrontSSHot.IsChecked == true) { - //if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - //{ - // //****** "域名不能为空,请检查相关参数设置!" ****** - // MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - // return; - //} testDomain = TestDomainIsEmpty(); //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLSWebFrontSS"; @@ -203,12 +197,6 @@ namespace ProxySU //SS+GoQuiet-Plugin模式被选中 else if (RadioButtonGoQuietPluginSS.IsChecked == true) { - //if (string.IsNullOrEmpty(TextBoxDomainSS.Text.ToString()) == true) - //{ - // //****** "域名不能为空,请检查相关参数设置!" ****** - // MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - // return; - //} testDomain = TestDomainIsEmpty(); //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "GoQuietPluginSS"; @@ -221,12 +209,6 @@ namespace ProxySU //SS+Cloak-Plugin模式被选中 else if (RadioButtonCloakPluginSS.IsChecked == true) { - //if (string.IsNullOrEmpty(TextBoxDomainSS.Text.ToString()) == true) - //{ - // //****** "域名不能为空,请检查相关参数设置!" ****** - // MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - // return; - //} testDomain = TestDomainIsEmpty(); //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "CloakPluginSS"; @@ -259,10 +241,6 @@ namespace ProxySU //无插件的界面 private void RadioButtonNonePluginSS_Checked(object sender, RoutedEventArgs e) { - //TextBlockServerListenPort.Visibility = Visibility.Visible; - //TextBoxServerListenPort.Visibility = Visibility.Visible; - //ButtonServerListenPort.Visibility = Visibility.Visible; - //隐藏Websocket Path TextBlockWebSocketPathSS.Visibility = Visibility.Collapsed; TextBoxWebSocketPathSS.Visibility = Visibility.Collapsed; diff --git a/ProxySU/Translations/ProxySU.en-US.xaml b/ProxySU/Translations/ProxySU.en-US.xaml index 40495df..31df416 100644 --- a/ProxySU/Translations/ProxySU.en-US.xaml +++ b/ProxySU/Translations/ProxySU.en-US.xaml @@ -93,8 +93,6 @@ Only the proxy software installed by ProxySU and related configurations are supported. Please make sure that important configurations have been backed up. Uninstalling agents installed using other methods or scripts is not supported. Are you sure you want to uninstall the agent software on the remote host? Start uninstall...... - - Home Forward @@ -115,6 +113,12 @@ V2Ray template library Popular Plan + VLESS + VLESS is a lightweight transmission protocol. Unlike VMess, VLESS don't depend on the system time. The authentication method is also UUID, but alterId is not required. Currently VLESS does not have its own encryption, please use it for reliable channels, such as TLS. Advantages: It can effectively reduce host resource consumption. Currently VLESS does not support sharing. Please ensure that both the client and server v2ray-core are the latest version. + XTLS works well on devices with low performance or without AES hard-decoding. For example, XTLS is used on hard routers, and the network speed can be doubled when the CPU is full, or the same The CPU occupancy rate is halved at Internet speed, and for mobile devices, the reduction in the amount of calculation means power saving.Version requires 4.29+ (Domain required) Not support CDN. + Lightweight protocol VLESS, occupies less host resources, data TLS encrypted transmission, and Caddy2 is used as a disguised website on the node. Suitable for VPS with low configuration, or shared nodes by multiple people, the server client version requires 4.27+ (Domain required) Notsupport CDN. + VLESS protocol, this type of solution with VMESS is more lightweight. Stability is strong, Caddy2 is front-facing, hidden proxy features, it is recognized as https traffic visiting the website, the strongest anti-blocking recognition, (Domain required) CDN is supported + VLESS protocol, this type of solution with VMESS is more lightweight. Based on HTTP/2 transmission. Completely implemented in accordance with the HTTP/2 standard, with Caddy2 as the front, hidden proxy features, H2C protocol forwarding to V2Ray, (Domain required) CloudFlare CDN is not supported TCP WebSocket Http/2 @@ -125,9 +129,11 @@ Random If TLS encryption is used, please keep the default port 443 Use the existing UUID and paste it directly into the box - mKCP Seed/QUIC key + QUIC Key: + mKCP Seed: Enable the mKCP Seed key to enhance anti-recognition, leave it blank to disable it. Version 4.24.2+ Path: + QUIC Encryption: Domain name: Mask a website: Set this item to increase the concealment of the agent (may be empty) @@ -140,8 +146,7 @@ TCP+TLS (self-signed certificate) Data encrypted transmission, the transmission protocol uses TLS, it will be recognized as TLS traffic, not equivalent to https traffic characteristics (no domain name required) Shadowrocket (ios) needs to manually open the "Allow Unsafe" option - Lightweight protocol VLESS, occupies less host resources, data TLS encrypted transmission, and Caddy2 is used as a disguised website on the node. Suitable for low-profile VPS, or shared nodes by multiple people, the server client version requires 4.27+ (domain name required) - Data encrypted transmission, the transmission protocol uses WebSocket, if TLS is not enabled, it will be recognized as WebSocket traffic. + Data encrypted transmission, the transmission protocol uses WebSocket, if TLS is not enabled, it will be recognized as WebSocket traffic. Data encrypted transmission, the transmission protocol uses WebSocket, and TLS is enabled, it will be recognized as TLS traffic. (Domain name required),Support CDN. WebSocket+TLS (self-signed certificate) Data encrypted transmission, the transmission protocol uses WebSocket, and TLS is enabled, and it will be recognized as TLS traffic. (No domain name required) @@ -177,12 +182,16 @@ Server address: Port: User ID(uuid): + Copy + Copied to the clipboard! + Empty content! alterId: The default is 16, and you can fill in a value not exceeding 64. If the client does not have this option, leave it blank Encryption method: Transfer Protocol: Camouflage type(Confuse): TLS: + Tip: Double-click the above content window to copy it to the clipboard. Path: mKCP Seed/QUIC key: default auto diff --git a/ProxySU/Translations/ProxySU.zh-CN.xaml b/ProxySU/Translations/ProxySU.zh-CN.xaml index c051c94..60df92c 100644 --- a/ProxySU/Translations/ProxySU.zh-CN.xaml +++ b/ProxySU/Translations/ProxySU.zh-CN.xaml @@ -118,6 +118,13 @@ V2Ray 模板库 推荐方案 + VLESS协议 + VLESS 是一个无状态的轻量传输协议,与 VMess 不同,VLESS 不依赖于系统时间,认证方式同样为 UUID,但不需要 alterId。目前 VLESS 没有自带加密,请用于可靠信道,如 TLS。优点:可以有效的降低主机资源消耗。目前 VLESS 不支持分享。VLESS 处于公测阶段,测试期间请确保客户端与服务端的 v2ray-core 均为最新版本。 + XTLS 在低性能或没有 AES 硬解的设备上效果出众,如在硬路由上换用 XTLS,同样跑满 CPU 时实现网速 翻倍,或是相同网速时 CPU 占用率减半,而对于移动设备,计算量减少意味着省电。服务端客户端版本要求4.29+ (需域名)不支持CDN。 + 轻量协议VLESS,占用更少主机资源,数据TLS加密传输,用Caddy2在节点上做伪装网站。适合配置低的VPS,或多人共用节点,服务端客户端版本要求4.27+ (需域名)不支持CDN。 + 使用VLESS协议,与VMESS的此类型方案,更轻量。稳定性强,Caddy2做前置,隐藏代理特征,被识别为访问网站的https流量,抗封锁识别最强,需要域名,支持CDN + 使用VLESS协议,与VMESS的此类型方案,更轻量。基于 HTTP/2 传输。完整按 HTTP/2 标准实现,Caddy2做前置,隐藏代理特征,H2C协议转发到V2Ray,需要域名,暂不支持CloudFlare的CDN + TCP传输协议 WebSocket传输协议 Http/2传输协议 @@ -128,9 +135,11 @@ 随机选择 若使用TLS加密,请保持默认的443端口 使用已有UUID,直接粘贴到框中 - mKCP Seed/QUIC密钥 + QUIC密钥: + mKCP Seed: 启用mKCP Seed密钥,可增强抗识别,留空则禁用,要求版本4.24.2+ 路径: + QUIC加密方式: 域名: 伪装网站: 设置此项可增加代理的隐蔽(可为空) @@ -143,7 +152,6 @@ TCP+TLS(自签证书) 数据加密传输,传输协议使用TLS,会被识别为TLS流量,不等同于https流量特征 (无需域名) Shadowrocket (ios)需要手动打开“允许不安全”选项 - 轻量协议VLESS,占用更少主机资源,数据TLS加密传输,用Caddy2在节点上做伪装网站。适合配置低的VPS,或多人共用节点,服务端客户端版本要求4.27+ (需域名) 数据加密传输,传输协议使用WebSocket,未启用TLS,将被识别为WebSocket流量。 数据加密传输,传输协议使用WebSocket,启用TLS,将被识别为TLS流量。(需要域名)支持CDN。 WebSocket+TLS(自签证书) @@ -180,14 +188,19 @@ 服务器地址(address): 端口(port): 用户ID(uuid): + 复制 + 已复制到剪贴板中! + 空内容! 额外ID: - 默认16,可以填不超过64的值,客户端没有此选项可不填 + 不超过64,客户端没此项可不填 加密方式: 传输协议: 伪装类型(混淆): 是否使用TLS: + 提示:双击以上内容窗,即可复制到剪贴板中。 路径(Path): - mKCP Seed/QUIC密钥: + QUIC密钥: + mKCP Seed: 默认auto 二维码/URL 以上参数可以手动或扫描输入客户端,用于官方客户端的配置和相关文件已经存放入目录下,点击 确定 按扭可打开 diff --git a/ProxySU/Translations/ProxySU.zh-TW.xaml b/ProxySU/Translations/ProxySU.zh-TW.xaml index a1ef498..03af2a7 100644 --- a/ProxySU/Translations/ProxySU.zh-TW.xaml +++ b/ProxySU/Translations/ProxySU.zh-TW.xaml @@ -115,6 +115,12 @@ V2Ray 模板庫 推薦方案 + VLESS協議 + VLESS 是一個無狀態的輕量傳輸協議,與 VMess 不同,VLESS 不依賴於系統時間,認證方式同樣為 UUID,但不需要 alterId。目前 VLESS 沒有自帶加密,請用於可靠信道,如 TLS。優點:可以有效的降低主機資源消耗。目前 VLESS 不支持分享。 VLESS 處於公測階段,測試期間請確保客戶端與服務端的 v2ray-core 均為最新版本。 + XTLS 在低性能或沒有AES 硬解的設備上效果出眾,如在硬路由上換用XTLS,同樣跑滿CPU 時實現網速翻倍,或是相同網速時CPU 佔用率減半,而對於移動設備,計算量減少意味著省電。服務端客戶端版本要求4.29+ (需域名)不支持CDN。 + 輕量協議VLESS,佔用更少主機資源,數據TLS加密傳輸,用Caddy2在節點上做偽裝網站。適合配置低的VPS,或多人共用節點,服務端客戶端版本要求4.27+ (需域名)不支持CDN。 + 使用VLESS協議,與VMESS的此類型方案,更輕量。穩定性強,Caddy2做前置,隱藏代理特徵,被識別為訪問網站的https流量,抗封鎖識別最強,需要域名,支持CDN + 使用VLESS協議,與VMESS的此類型方案,更輕量。基於 HTTP/2 傳輸。完整按 HTTP/2 標準實現,Caddy2做前置,隱藏代理特徵,H2C協議轉發到V2Ray,需要域名,暫不支持CloudFlare的CDN TCP傳輸協議 WebSocket傳輸協議 Http/2傳輸協議 @@ -125,9 +131,11 @@ 隨機選擇 若使用TLS加密,請保持默認的443端口 使用已有UUID,直接粘貼到框中 - mKCP Seed/QUIC密鑰 + QUIC密鑰: + mKCP Seed: 啟用mKCP Seed密鑰,可增強抗識別,留空則禁用,要求版本4.24.2+ 路徑: + QUIC加密方式: 域名: 偽裝網站: 設置此項可增加代理的隱蔽(可為空) @@ -140,7 +148,6 @@ TCP+TLS(自簽證書) 數據加密傳輸,傳輸協議使用TLS,會被識別為TLS流量,不等同於https流量特徵 (無需域名) Shadowrocket (ios)需要手動打開“允許不安全”選項 - 輕量協議VLESS,佔用更少主機資源,數據TLS加密傳輸,用Caddy2在節點上做偽裝網站。適合配置低的VPS,或多人共用節點,服務端客戶端版本要求4.27+ (需域名) 數據加密傳輸,傳輸協議使用WebSocket,未啟用TLS,將被識別為WebSocket流量。 數據加密傳輸,傳輸協議使用WebSocket,啟用TLS,將被識別為TLS流量。 (需要域名)支持CDN。 WebSocket+TLS(自簽證書) @@ -177,12 +184,16 @@ 服務器地址(address): 端口(port): 用戶ID(uuid): + 複製 + 已復製到剪貼板中! + 空內容! 額外ID: - 默認16,可以填不超過64的值,客戶端沒有此選項可不填 + 不超過64,客戶端沒此項可不填 加密方式: 傳輸協議: 偽裝類型(混淆): 是否使用TLS: + 提示:雙擊以上內容窗,即可複製到剪貼板中。 路徑(Path): mKCP Seed/QUIC密鑰: 默認auto diff --git a/ProxySU/V2RayTemplateWindow.xaml b/ProxySU/V2RayTemplateWindow.xaml index d481434..9438af8 100644 --- a/ProxySU/V2RayTemplateWindow.xaml +++ b/ProxySU/V2RayTemplateWindow.xaml @@ -67,6 +67,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -94,11 +131,10 @@ - - - + + @@ -177,17 +213,17 @@ - + - + - + - + - + - + @@ -259,14 +295,20 @@ - - - + + + + + + + + + diff --git a/ProxySU/V2RayTemplateWindow.xaml.cs b/ProxySU/V2RayTemplateWindow.xaml.cs index d56f7bd..52c0438 100644 --- a/ProxySU/V2RayTemplateWindow.xaml.cs +++ b/ProxySU/V2RayTemplateWindow.xaml.cs @@ -19,10 +19,35 @@ namespace ProxySU /// public partial class WindowTemplateConfiguration : Window { + //QUIC 加密方法 + public class EncryptionMethodInfo + { + public string Name { get; set; } + public string Value { get; set; } + } + public WindowTemplateConfiguration() { InitializeComponent(); - //RadioButtonTCP.IsChecked = true; + + #region 加密方法选择 初始设置为chacha20-poly1305 + List methodList = new List(); + + methodList.Add(new EncryptionMethodInfo { Name = "chacha20-poly1305", Value = "chacha20-poly1305" }); + methodList.Add(new EncryptionMethodInfo { Name = "aes-128-gcm", Value = "aes-128-gcm" }); + methodList.Add(new EncryptionMethodInfo { Name = "none", Value = "none" }); + + ComboBoxEncryptionMethodInfo.ItemsSource = methodList; + + ComboBoxEncryptionMethodInfo.DisplayMemberPath = "Name";//显示出来的值 + ComboBoxEncryptionMethodInfo.SelectedValuePath = "Value";//实际选中后获取的结果的值 + ComboBoxEncryptionMethodInfo.SelectedIndex = 0; + + DataContext = this; + #endregion + + //隐藏QUIC密钥 + FirstQuicHideEncryption(); } //取消不在当前活动选项卡中的其他所有选项卡中的所有RadioBuuton的选中状态 //代码参考网址:https://blog.csdn.net/weixin_42583999/article/details/103468857 @@ -45,9 +70,13 @@ namespace ProxySU } } + //传递所选择的参数与模板方案 private void ButtondDecide_Click(object sender, RoutedEventArgs e) { - //UncheckLayouts(TabControlTemplate); + bool domainNotEmpty = true; + + #region TCP 传输协议(VMESS) + //TCP模式被选中 if (RadioButtonTCP.IsChecked == true) { @@ -57,6 +86,7 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[8] = RadioButtonTCP.Content.ToString(); } + //TCP+http伪装模式被选中 else if (RadioButtonTCPhttp.IsChecked == true) { @@ -68,15 +98,12 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[5] = "http"; } + //TCP+TLS模式被选中 else if (RadioButtonTCP2TLS.IsChecked == true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "tcpTLS"; //传递方案名称 @@ -86,6 +113,7 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); } + //tcp+TLS(自签证书)模式被选中 else if (RadioButtonTcpTLS2SelfSigned.IsChecked == true) { @@ -98,15 +126,35 @@ namespace ProxySU // MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); } - //VLESS+TCP+TLS+Caddy模式选中 + + #endregion + + #region VLESS协议 + + //VLESS+TCP+XTLS+Web模式选中 + else if (RadioButtonVlessXtlsTcp.IsChecked == true) + { + domainNotEmpty = TestDomainIsEmpty(); + + //传递模板类型 + MainWindow.ReceiveConfigurationParameters[0] = "VlessXtlsTcp"; + //传递方案名称 + MainWindow.ReceiveConfigurationParameters[8] = RadioButtonVlessXtlsTcp.Content.ToString(); + + //传递域名 + MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); + //传递伪装网站 + MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); + //处理伪装网站域名中的前缀 + DisguiseURLprocessing(); + + } + + //VLESS+TCP+TLS+Web模式选中 else if (RadioButtonVlessTcpTlsWeb.IsChecked == true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "VlessTcpTlsWeb"; //传递方案名称 @@ -118,20 +166,53 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); //处理伪装网站域名中的前缀 DisguiseURLprocessing(); - //if (TextBoxMaskSites.Text.ToString().Length >= 7) - //{ - // 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; - // } - //} + } + + //VLESS+WebSocket+TLS+Web模式选中 + else if (RadioButtonVlessWebSocketTlsWeb.IsChecked == true) + { + domainNotEmpty = TestDomainIsEmpty(); + + //传递模板类型 + MainWindow.ReceiveConfigurationParameters[0] = "VlessWebSocketTlsWeb"; + //传递方案名称 + MainWindow.ReceiveConfigurationParameters[8] = RadioButtonVlessWebSocketTlsWeb.Content.ToString(); + + //传递路径 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); + //传递域名 + MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); + //传递伪装网站 + MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); + //处理伪装网站域名中的前缀 + DisguiseURLprocessing(); + } + + //VLESS+http2+TLS+Web模式选中 + else if (RadioButtonVlessHttp2Web.IsChecked == true) + { + domainNotEmpty = TestDomainIsEmpty(); + + //传递模板类型 + MainWindow.ReceiveConfigurationParameters[0] = "VlessHttp2Web"; + //传递方案名称 + MainWindow.ReceiveConfigurationParameters[8] = RadioButtonVlessHttp2Web.Content.ToString(); + + //传递路径 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); + //传递域名 + MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); + //传递伪装网站 + MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); + //处理伪装网站域名中的前缀 + DisguiseURLprocessing(); + } + + #endregion + + #region WebSocket传输协议(VMESS) + //webSocket模式被选中 else if (RadioButtonWebSocket.IsChecked == true) { @@ -141,21 +222,18 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocket.Content.ToString(); } + //WebSocket+TLS模式被选中 else if (RadioButtonWebSocketTLS.IsChecked == true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocketTLS.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); @@ -164,39 +242,24 @@ namespace ProxySU //WebSocket+TLS+Web模式被选中 else if (RadioButtonWebSocketTLS2Web.IsChecked == true|| RadioButtonWebSocketTLS2WebHot.IsChecked==true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS2Web"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocketTLS2Web.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); //传递伪装网站 MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); //处理伪装网站域名中的前缀 DisguiseURLprocessing(); - //if (TextBoxMaskSites.Text.ToString().Length >= 7) - //{ - // 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; - // } - //} + } + //WebSocket+TLS(自签证书)模式被选中 else if (RadioButtonWebSocketTLSselfSigned.IsChecked == true) { @@ -206,67 +269,54 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocketTLSselfSigned.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 //MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); } + + #endregion + + #region http2传输协议(VMESS) + //http2模式被选中 else if (RadioButtonHTTP2.IsChecked == true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "Http2"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonHTTP2.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); } + //http2+TLS+Web模式被选中 else if (RadioButtonHTTP2Web.IsChecked == true || RadioButtonHTTP2WebHot.IsChecked == true) { - if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) - { - //****** "域名不能为空,请检查相关参数设置!" ****** - MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); - return; - } + domainNotEmpty = TestDomainIsEmpty(); + //传递模板类型 MainWindow.ReceiveConfigurationParameters[0] = "http2Web"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonHTTP2Web.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); //传递伪装网站 MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString(); //处理伪装网站域名中的前缀 DisguiseURLprocessing(); - //if (TextBoxMaskSites.Text.ToString().Length >= 7) - //{ - // 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; - // } - //} + } + //http2(自签证书)模式被选中 else if (RadioButtonHTTP2selfSigned.IsChecked == true) { @@ -276,11 +326,16 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[8] = RadioButtonHTTP2selfSigned.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text.ToString(); //传递域名 //MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); } + + #endregion + + #region mKCP 传输协议 (VMESS) + //mKCP无伪装模式被选中 else if (RadioButtonMkcpNone.IsChecked == true) { @@ -288,14 +343,15 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCPNone"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonMkcpNone.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "none"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text)==false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text)==false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + //mKCP+srtp伪装模式被选中 else if (RadioButton2mKCP2SRTP.IsChecked == true) { @@ -303,14 +359,15 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCP2SRTP"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButton2mKCP2SRTP.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "srtp"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text) == false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + //mKCP+utp伪装模式被选中 else if (RadioButton2mKCPuTP.IsChecked == true) { @@ -318,14 +375,15 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCPuTP"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButton2mKCPuTP.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "utp"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text) == false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + //mKCP+wechat-video伪装模式被选中 else if (RadioButton2mKCP2WechatVideo.IsChecked == true) { @@ -333,14 +391,15 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WechatVideo"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButton2mKCP2WechatVideo.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "wechat-video"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text) == false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + //mKCP+dtls伪装模式被选中 else if (RadioButton2mKCP2DTLS.IsChecked == true) { @@ -348,14 +407,15 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCP2DTLS"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButton2mKCP2DTLS.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "dtls"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text) == false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + //mKCP+wireguard伪装模式被选中 else if (RadioButton2mKCP2WireGuard.IsChecked == true) { @@ -363,14 +423,19 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButton2mKCP2WireGuard.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "wireguard"; //传递mKCP Seed - if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false) + if (String.IsNullOrEmpty(TextBoxQuicAndMkcpSeedUUID.Text) == false) { - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; } } + + #endregion + + #region QUIC传输协议(VMESS) + //QUIC无伪装模式被选中 else if (RadioButtonQuicNone.IsChecked == true) { @@ -378,10 +443,14 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "QuicNone"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuicNone.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "none"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } + //QUIC+srtp伪装模式被选中 else if (RadioButtonQuicSRTP.IsChecked == true) { @@ -389,10 +458,14 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "QuicSRTP"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuicSRTP.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "srtp"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } + //QUIC+utp伪装模式被选中 else if (RadioButtonQuic2uTP.IsChecked == true) { @@ -400,10 +473,14 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "Quic2uTP"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuic2uTP.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "utp"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } + //QUIC+wechat-video伪装模式被选中 else if (RadioButtonQuicWechatVideo.IsChecked == true) { @@ -411,10 +488,14 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "QuicWechatVideo"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuicWechatVideo.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "wechat-video"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } + //QUIC+dtls伪装模式被选中 else if (RadioButtonQuicDTLS.IsChecked == true) { @@ -422,10 +503,14 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "QuicDTLS"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuicDTLS.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "dtls"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } + //QUIC+wireguard伪装模式被选中 else if (RadioButtonQuicWireGuard.IsChecked == true) { @@ -433,27 +518,29 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "QuicWireGuard"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonQuicWireGuard.Content.ToString(); - + //传递伪装类型 MainWindow.ReceiveConfigurationParameters[5] = "wireguard"; - MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text; + //QUIC 密钥 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicAndMkcpSeedUUID.Text; + //QUIC加密方法 + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } - ////默认模式为 TCP - //else - //{ - // //传递模板类型 - // MainWindow.ReceiveConfigurationParameters[0] = "TCP"; - // //传递方案名称 - // MainWindow.ReceiveConfigurationParameters[8] = RadioButtonTCP.Content.ToString(); - //} + #endregion + //传递服务端口 MainWindow.ReceiveConfigurationParameters[1] = TextBoxServerListenPort.Text.ToString(); //传递uuid MainWindow.ReceiveConfigurationParameters[2] = TextBoxNewUUID.Text.ToString(); - this.Close(); + if (domainNotEmpty) + { + this.Close(); + } + } + //取消选择返回主窗口 private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close(); @@ -463,8 +550,8 @@ namespace ProxySU //处理伪装网站域名中的前缀 if (TextBoxMaskSites.Text.ToString().Length >= 7) { - string testDomain = TextBoxMaskSites.Text.Substring(0, 7); - if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://")) + string testDomainMask = TextBoxMaskSites.Text.Substring(0, 7); + if (String.Equals(testDomainMask, "https:/") || String.Equals(testDomainMask, "http://")) { //MessageBox.Show(testDomain); MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.Replace("/", "\\/"); @@ -475,28 +562,25 @@ namespace ProxySU } } } + #region 其他设置中的界面控制 + private void RadioButtonTCP_Checked(object sender, RoutedEventArgs e) { - //TextBlockServerListenPort.Visibility = Visibility.Visible; - //TextBoxServerListenPort.Visibility = Visibility.Visible; - //ButtonServerListenPort.Visibility = Visibility.Visible; + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + //隐藏Path - TextBlockPath.Visibility = Visibility.Collapsed; - TextBoxPath.Visibility = Visibility.Collapsed; - ButtonPath.Visibility = Visibility.Collapsed; + HidePath(); + //隐藏域名 - TextBlockDomain.Visibility = Visibility.Collapsed; - TextBoxDomain.Visibility = Visibility.Collapsed; - ButtonDomain.Visibility = Visibility.Collapsed; + HideDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); @@ -509,27 +593,22 @@ namespace ProxySU } private void RadioButtonTCPhttp_Checked(object sender, RoutedEventArgs e) { - //TextBlockServerListenPort.Visibility = Visibility.Visible; - //TextBoxServerListenPort.Visibility = Visibility.Visible; - //ButtonServerListenPort.Visibility = Visibility.Visible; TextBoxServerListenPort.Text = "80"; + + //隐藏mKCP项 + HideMkcpSeed(); + + //隐藏QUIC密钥 + HideQuic(); + //隐藏Path - TextBlockPath.Visibility = Visibility.Collapsed; - TextBoxPath.Visibility = Visibility.Collapsed; - ButtonPath.Visibility = Visibility.Collapsed; + HidePath(); //隐藏域名 - TextBlockDomain.Visibility = Visibility.Collapsed; - TextBoxDomain.Visibility = Visibility.Collapsed; - ButtonDomain.Visibility = Visibility.Collapsed; - //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); @@ -539,23 +618,45 @@ namespace ProxySU 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; + + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + + //隐藏Path + HidePath(); + + //显示域名 + ShowDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); + + Guid uuid = Guid.NewGuid(); + TextBoxNewUUID.Text = uuid.ToString(); + //清除其他选项卡中的选项 + UncheckLayouts((TabItem)TabControlTemplate.SelectedItem); + } + private void RadioButtonVlessTcpTlsWeb_Checked(object sender, RoutedEventArgs e) + { + TextBoxServerListenPort.Text = "443"; + + //隐藏mKCP项 + HideMkcpSeed(); + + //隐藏QUIC密钥 + HideQuic(); + + //隐藏Path + HidePath(); + + //显示域名 + ShowDomain(); + + //显示伪装网站 + ShowMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); @@ -565,23 +666,21 @@ namespace ProxySU 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; + + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + + //隐藏Path + HidePath(); + + //隐藏域名 + HideDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); @@ -590,30 +689,22 @@ namespace ProxySU } 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; + + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + + //显示Path + ShowPath(); + + //显示域名 + ShowDomain(); + //显示伪装网站 - //TextBlockMaskSites.Visibility = Visibility.Visible; - //TextBoxMaskSites.Visibility = Visibility.Visible; - //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + ShowMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); @@ -622,28 +713,22 @@ namespace ProxySU } private void RadioButtonWebSocketTLSselfSigned_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.Collapsed; - TextBoxDomain.Visibility = Visibility.Collapsed; - //TextBoxDomain.Tag = "可为空"; - //ButtonDomain.Visibility = Visibility.Visible; + + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + + //显示Path + ShowPath(); + + //隐藏域名 + HideDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); @@ -652,57 +737,52 @@ namespace ProxySU } private void RadioButtonHTTP2_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; + + //隐藏mKCP项 + HideMkcpSeed(); + //隐藏QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Collapsed; - TextBoxQuicUUID.Visibility = Visibility.Collapsed; - ButtonQuicUUID.Visibility = Visibility.Collapsed; - TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + HideQuic(); + + //显示Path + ShowPath(); + + //显示域名 + ShowDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); //清除其他选项卡中的选项 UncheckLayouts((TabItem)TabControlTemplate.SelectedItem); } - private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e) + + //mKCP显示界面 + private void RadioButtonMkcp_Checked(object sender, RoutedEventArgs e) { - //显示QUIC密钥 - TextBlockQuicUUID.Visibility = Visibility.Visible; - TextBoxQuicUUID.Visibility = Visibility.Visible; - ButtonQuicUUID.Visibility = Visibility.Visible; - TextBlockMkcpUUID.Visibility = Visibility.Visible; + //隐藏QUIC密钥 + HideQuic(); + + //显示mKCP Seed + ShowMkcpSeed(); + //隐藏Path - TextBlockPath.Visibility = Visibility.Collapsed; - TextBoxPath.Visibility = Visibility.Collapsed; - ButtonPath.Visibility = Visibility.Collapsed; + HidePath(); + //隐藏域名 - TextBlockDomain.Visibility = Visibility.Collapsed; - TextBoxDomain.Visibility = Visibility.Collapsed; - ButtonDomain.Visibility = Visibility.Collapsed; + HideDomain(); + //隐藏伪装网站 - TextBlockMaskSites.Visibility = Visibility.Collapsed; - TextBoxMaskSites.Visibility = Visibility.Collapsed; + HideMaskSites(); Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); uuid = Guid.NewGuid(); - TextBoxQuicUUID.Text = uuid.ToString(); + TextBoxQuicAndMkcpSeedUUID.Text = uuid.ToString(); //Random random = new Random(); int randomServerPort = GetRandomPort(); @@ -710,6 +790,139 @@ namespace ProxySU //清除其他选项卡中的选项 UncheckLayouts((TabItem)TabControlTemplate.SelectedItem); } + + //QUIC显示界面 + private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e) + { + //隐藏mKCP项 + HideMkcpSeed(); + + //显示QUIC密钥 + ShowQuic(); + + //隐藏Path + HidePath(); + + //隐藏域名 + HideDomain(); + + //隐藏伪装网站 + HideMaskSites(); + + Guid uuid = Guid.NewGuid(); + TextBoxNewUUID.Text = uuid.ToString(); + + uuid = Guid.NewGuid(); + TextBoxQuicAndMkcpSeedUUID.Text = uuid.ToString(); + + //Random random = new Random(); + int randomServerPort = GetRandomPort(); + TextBoxServerListenPort.Text = randomServerPort.ToString(); + //清除其他选项卡中的选项 + UncheckLayouts((TabItem)TabControlTemplate.SelectedItem); + } + + + //隐藏QUIC相关项 + private void HideQuic() + { + TextBlockQuicUUID.Visibility = Visibility.Collapsed; + TextBoxQuicAndMkcpSeedUUID.Visibility = Visibility.Collapsed; + ButtonQuicAndmKcpSeedUUID.Visibility = Visibility.Collapsed; + TextBlockQuicEncryption.Visibility = Visibility.Collapsed; + ComboBoxEncryptionMethodInfo.Visibility = Visibility.Collapsed; + //TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + } + //如果加密方法选择none,则隐藏只QUIC密钥 + private void NoneEncryptionHideQuicKey() + { + TextBlockQuicUUID.Visibility = Visibility.Collapsed; + TextBoxQuicAndMkcpSeedUUID.Visibility = Visibility.Collapsed; + ButtonQuicAndmKcpSeedUUID.Visibility = Visibility.Collapsed; + } + //窗口初始化时,需要做一次隐藏QUIC加密方法 + private void FirstQuicHideEncryption() + { + TextBlockQuicEncryption.Visibility = Visibility.Collapsed; + ComboBoxEncryptionMethodInfo.Visibility = Visibility.Collapsed; + } + //显示QUIC相关项 + private void ShowQuic() + { + TextBlockQuicUUID.Visibility = Visibility.Visible; + TextBoxQuicAndMkcpSeedUUID.Visibility = Visibility.Visible; + ButtonQuicAndmKcpSeedUUID.Visibility = Visibility.Visible; + TextBlockQuicEncryption.Visibility = Visibility.Visible; + ComboBoxEncryptionMethodInfo.Visibility = Visibility.Visible; + + //隐藏mKCP相关项 + TextBlockMkcpSeedUUID.Visibility = Visibility.Collapsed; + TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + } + //隐藏mKCP Seed相关项 + private void HideMkcpSeed() + { + TextBlockMkcpSeedUUID.Visibility = Visibility.Collapsed; + TextBoxQuicAndMkcpSeedUUID.Visibility = Visibility.Collapsed; + ButtonQuicAndmKcpSeedUUID.Visibility = Visibility.Collapsed; + TextBlockMkcpUUID.Visibility = Visibility.Collapsed; + + } + //显示mKCP Seed相关项 + private void ShowMkcpSeed() + { + TextBlockMkcpSeedUUID.Visibility = Visibility.Visible; + TextBoxQuicAndMkcpSeedUUID.Visibility = Visibility.Visible; + ButtonQuicAndmKcpSeedUUID.Visibility = Visibility.Visible; + TextBlockMkcpUUID.Visibility = Visibility.Visible; + //隐藏QUIC标示 + TextBlockQuicUUID.Visibility = Visibility.Collapsed; + } + //隐藏路径相关项 + private void HidePath() + { + //隐藏Path + TextBlockPath.Visibility = Visibility.Collapsed; + TextBoxPath.Visibility = Visibility.Collapsed; + ButtonPath.Visibility = Visibility.Collapsed; + } + //显示路径相关项 + private void ShowPath() + { + //显示Path + TextBlockPath.Visibility = Visibility.Visible; + TextBoxPath.Visibility = Visibility.Visible; + TextBoxPath.Text = "/ray"; + ButtonPath.Visibility = Visibility.Visible; + } + //隐藏域名相关项 + private void HideDomain() + { + //隐藏域名 + TextBlockDomain.Visibility = Visibility.Collapsed; + TextBoxDomain.Visibility = Visibility.Collapsed; + ButtonDomain.Visibility = Visibility.Collapsed; + } + //显示域名相关项 + private void ShowDomain() + { + //显示域名 + TextBlockDomain.Visibility = Visibility.Visible; + TextBoxDomain.Visibility = Visibility.Visible; + //ButtonDomain.Visibility = Visibility.Visible; + } + //隐藏伪装网站 + private void HideMaskSites() + { + TextBlockMaskSites.Visibility = Visibility.Collapsed; + TextBoxMaskSites.Visibility = Visibility.Collapsed; + } + //显示伪装网站 + private void ShowMaskSites() + { + TextBlockMaskSites.Visibility = Visibility.Collapsed; + TextBoxMaskSites.Visibility = Visibility.Collapsed; + } #endregion //产生随机的uuid @@ -718,12 +931,14 @@ namespace ProxySU Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = uuid.ToString(); } + //产生QUIC密钥/mKCP Seed所用的UUID - private void ButtonQuicUUID_Click(object sender, RoutedEventArgs e) + private void ButtonQuicAndMkcpSeedUUID_Click(object sender, RoutedEventArgs e) { Guid uuid = Guid.NewGuid(); - TextBoxQuicUUID.Text = uuid.ToString(); + TextBoxQuicAndMkcpSeedUUID.Text = uuid.ToString(); } + //产生随机服务端口 private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e) { @@ -731,6 +946,7 @@ namespace ProxySU int randomServerPort = GetRandomPort(); TextBoxServerListenPort.Text = randomServerPort.ToString(); } + //产生随机的Path private void ButtonPath_Click(object sender, RoutedEventArgs e) { @@ -742,17 +958,63 @@ namespace ProxySU TextBoxPath.Text = $"/{path}"; //MessageBox.Show(path); } + //产生随机端口 private int GetRandomPort() { Random random = new Random(); return random.Next(10001, 60000); } + + //域名检测是否为空 + private bool TestDomainIsEmpty() + { + if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) + { + //****** "域名不能为空,请检查相关参数设置!" ****** + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); + return false; + } + else + { + return true; + } + } + + //加密方法更改后的动作 + private void ComboBoxEncryptionMethodInfo_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + string getMethond = GetEncryptionMethodSS(); + //传递加密方式 + MainWindow.ReceiveConfigurationParameters[3] = getMethond; + if (String.Equals(getMethond,"none")) + { + NoneEncryptionHideQuicKey(); + } + else + { + ShowQuic(); + } + + } + + //读取加密方式 + private string GetEncryptionMethodSS() + { + //string methodName; + //object methodSelected; + //methodSelected = ComboBoxEncryptionMethodInfo.SelectedValue; + //methodName = methodSelected.ToString(); + //return methodName; + return ComboBoxEncryptionMethodInfo.SelectedValue.ToString(); + } private void ButtonDomain_Click(object sender, RoutedEventArgs e) { } + + //private void ButtonTestChecked_Click(object sender, RoutedEventArgs e) //{ // UncheckLayouts((TabItem)TabControlTemplate.SelectedItem); diff --git a/ProxySU/bin/Beta/Beta.zip b/ProxySU/bin/Beta/Beta.zip index 14d2e04..1343bb7 100644 Binary files a/ProxySU/bin/Beta/Beta.zip and b/ProxySU/bin/Beta/Beta.zip differ diff --git a/TemplateConfg/v2ray/client/06_outbounds/vless_http2_tls_server_config.json b/TemplateConfg/v2ray/client/06_outbounds/vless_http2_tls_server_config.json new file mode 100644 index 0000000..c7c2c22 --- /dev/null +++ b/TemplateConfg/v2ray/client/06_outbounds/vless_http2_tls_server_config.json @@ -0,0 +1,32 @@ +{ + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": null, + "port": 443, + "users": [ + { + "id": null, + "encryption": "none", + "level": 0 + } + ] + } + ] + }, + "streamSettings": { + "network": "h2", + "security": "tls", + "httpSettings": { + "path": null, + "host": [ + "" + ] + } + } + } + ] +} \ No newline at end of file diff --git a/TemplateConfg/v2ray/client/06_outbounds/tcp_vless_tls_caddy_cilent_config.json b/TemplateConfg/v2ray/client/06_outbounds/vless_tcp_tls_caddy_cilent_config.json similarity index 100% rename from TemplateConfg/v2ray/client/06_outbounds/tcp_vless_tls_caddy_cilent_config.json rename to TemplateConfg/v2ray/client/06_outbounds/vless_tcp_tls_caddy_cilent_config.json diff --git a/TemplateConfg/v2ray/client/06_outbounds/vless_tcp_xtls_client_config.json b/TemplateConfg/v2ray/client/06_outbounds/vless_tcp_xtls_client_config.json new file mode 100644 index 0000000..c5d9008 --- /dev/null +++ b/TemplateConfg/v2ray/client/06_outbounds/vless_tcp_xtls_client_config.json @@ -0,0 +1,29 @@ +{ + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": null, + "port": 443, + "users": [ + { + "id": null, + "flow": "xtls-rprx-origin", + "encryption": "none" + } + ] + } + ] + }, + "streamSettings": { + "network": "tcp", + "security": "xtls", + "xtlsSettings": { + "serverName": "" + } + } + } + ] +} \ No newline at end of file diff --git a/TemplateConfg/v2ray/client/06_outbounds/vless_ws_tls_client_config.json b/TemplateConfg/v2ray/client/06_outbounds/vless_ws_tls_client_config.json new file mode 100644 index 0000000..8a10182 --- /dev/null +++ b/TemplateConfg/v2ray/client/06_outbounds/vless_ws_tls_client_config.json @@ -0,0 +1,32 @@ +{ + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": null, + "port": 443, + "users": [ + { + "id": null, + "encryption": "none", + "level": 0 + } + ] + } + ] + }, + "streamSettings": { + "network": "ws", + "security": "tls", + "tlsSettings": { + "serverName": "" + }, + "wsSettings": { + "path": "" + } + } + } + ] +} \ No newline at end of file diff --git a/TemplateConfg/v2ray/server/05_inbounds/vless_http2_tls_server_config.json b/TemplateConfg/v2ray/server/05_inbounds/vless_http2_tls_server_config.json new file mode 100644 index 0000000..96bc51f --- /dev/null +++ b/TemplateConfg/v2ray/server/05_inbounds/vless_http2_tls_server_config.json @@ -0,0 +1,27 @@ +{ + "inbounds": [ + { + "port": 10000, + "listen": "127.0.0.1", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "h2", + "security": "none", + "httpSettings": { + "path": null, + "host": [ + "" + ] + } + } + } + ] +} \ No newline at end of file diff --git a/TemplateConfg/v2ray/server/05_inbounds/tcp_vless_tls_caddy_server_config.json b/TemplateConfg/v2ray/server/05_inbounds/vless_tcp_tls_server_config.json similarity index 100% rename from TemplateConfg/v2ray/server/05_inbounds/tcp_vless_tls_caddy_server_config.json rename to TemplateConfg/v2ray/server/05_inbounds/vless_tcp_tls_server_config.json diff --git a/TemplateConfg/v2ray/server/05_inbounds/vless_tcp_xtls_server_config.json b/TemplateConfg/v2ray/server/05_inbounds/vless_tcp_xtls_server_config.json new file mode 100644 index 0000000..3493a91 --- /dev/null +++ b/TemplateConfg/v2ray/server/05_inbounds/vless_tcp_xtls_server_config.json @@ -0,0 +1,37 @@ +{ + "inbounds": [ + { + "port": 443, + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "", + "flow": "xtls-rprx-origin" + } + ], + "decryption": "none", + "fallbacks": [ + { + "dest": 8800 + } + ] + }, + "streamSettings": { + "network": "tcp", + "security": "xtls", + "xtlsSettings": { + "alpn": [ + "http/1.1" + ], + "certificates": [ + { + "certificateFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.crt", + "keyFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.key" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/TemplateConfg/v2ray/server/05_inbounds/vless_ws_tls_server_config.json b/TemplateConfg/v2ray/server/05_inbounds/vless_ws_tls_server_config.json new file mode 100644 index 0000000..fc398df --- /dev/null +++ b/TemplateConfg/v2ray/server/05_inbounds/vless_ws_tls_server_config.json @@ -0,0 +1,24 @@ +{ + "inbounds": [ + { + "port": 10000, + "listen": "127.0.0.1", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "ws", + "security": "none", + "wsSettings": { + "path": "" + } + } + } + ] +} \ No newline at end of file