diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index d591ba4..c0dd46b 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.4.0" Height="675" Width="650"> + Title="ProxySU - v2.4.1" Height="675" Width="650"> diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index c170935..ab9d9f0 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]----QUIC加密方式/SSR 加密方法/naive'user/VLESS ws Path + //ReceiveConfigurationParameters[3]----QUIC加密方式/SSR 加密方法/SS 加密方式/naive'user/VLESS ws Path //ReceiveConfigurationParameters[4]----Domain //ReceiveConfigurationParameters[5]----伪装类型/插件名称 - //ReceiveConfigurationParameters[6]----Websocket'Path/http2'Path/QUIC密钥/mKCP Seed/SS 加密方式/VMESS ws Path + //ReceiveConfigurationParameters[6]----V2Ray&Trojan-go&SS--Websocket'Path/http2'Path/QUIC密钥/mKCP Seed/VMESS ws Path //ReceiveConfigurationParameters[7]----伪装网站 //ReceiveConfigurationParameters[8]----方案名称 //ReceiveConfigurationParameters[9]----插件参数选项/VMESS tcp Path @@ -3595,7 +3595,7 @@ namespace ProxySU TextBlockTrojanGoCurrentlySelectedPlanPassword.Visibility = Visibility.Visible; TextBlockTrojanGoShowPath.Text = "WebSocket Path:"; - TextBlockTrojanGoCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[3]; //mKCP Seed\Quic Key\Path + TextBlockTrojanGoCurrentlySelectedPlanPathSeedKey.Text = ReceiveConfigurationParameters[6]; //mKCP Seed\Quic Key\Path TextBlockTrojanGoShowPath.Visibility = Visibility.Visible; @@ -4281,7 +4281,7 @@ namespace ProxySU if (String.Equals(ReceiveConfigurationParameters[0], "TrojanGoWebSocketTLS2Web")) { serverJson["websocket"]["enabled"] = true; - serverJson["websocket"]["path"] = ReceiveConfigurationParameters[3]; + serverJson["websocket"]["path"] = ReceiveConfigurationParameters[6]; } using (StreamWriter sw = new StreamWriter(@"config.json")) @@ -4880,7 +4880,7 @@ namespace ProxySU if (String.Equals(ReceiveConfigurationParameters[0], "TrojanGoWebSocketTLS2Web")) { clientJson["websocket"]["enabled"] = true; - clientJson["websocket"]["path"] = ReceiveConfigurationParameters[3]; + clientJson["websocket"]["path"] = ReceiveConfigurationParameters[6]; } using (StreamWriter sw = new StreamWriter(@"trojan-go_config\config.json")) @@ -9279,9 +9279,9 @@ namespace ProxySU TextBlockCurrentlySelectedPlanSS.Text = ReceiveConfigurationParameters[8]; //所选方案名称 TextBlockCurrentlySelectedPlanPortSS.Text = ReceiveConfigurationParameters[1]; //服务器端口 TextBlockCurrentlySelectedPlanUUIDSS.Text = ReceiveConfigurationParameters[2]; //密码 - TextBlockCurrentlySelectedPlanMethodSS.Text = ReceiveConfigurationParameters[6]; //加密方法 + TextBlockCurrentlySelectedPlanMethodSS.Text = ReceiveConfigurationParameters[3]; //加密方法 TextBlockCurrentlySelectedPlanDomainSS.Text = ReceiveConfigurationParameters[4]; //域名 - TextBlockCurrentlySelectedPlanPathSS.Text = ReceiveConfigurationParameters[3]; //WebSocket Path + TextBlockCurrentlySelectedPlanPathSS.Text = ReceiveConfigurationParameters[6]; //WebSocket Path TextBlockCurrentlySelectedPlanFakeWebsite.Text = ReceiveConfigurationParameters[7]; //伪装网站 if (String.Equals(ReceiveConfigurationParameters[0], "NonePluginSS") @@ -10135,7 +10135,7 @@ namespace ProxySU //设置监听端口 serverJson["server_port"]= int.Parse(ReceiveConfigurationParameters[1]); //设置加密方式 - serverJson["method"] = ReceiveConfigurationParameters[6]; + serverJson["method"] = ReceiveConfigurationParameters[3]; //产生伪装Web的监听端口 randomCaddyListenPort = GetRandomPort(); @@ -10172,11 +10172,11 @@ namespace ProxySU { serverJson["server_port"] = 10000; serverJson["plugin"] = @"v2ray-plugin"; - serverJson["plugin_opts"] = $"server;host={ReceiveConfigurationParameters[4]};path={ReceiveConfigurationParameters[3]}"; + serverJson["plugin_opts"] = $"server;host={ReceiveConfigurationParameters[4]};path={ReceiveConfigurationParameters[6]}"; //客户端项 ReceiveConfigurationParameters[5] = @"v2ray-plugin"; - ReceiveConfigurationParameters[9] = $"tls;host={ReceiveConfigurationParameters[4]};path={ReceiveConfigurationParameters[3]}"; + ReceiveConfigurationParameters[9] = $"tls;host={ReceiveConfigurationParameters[4]};path={ReceiveConfigurationParameters[6]}"; } else if (String.Equals(ReceiveConfigurationParameters[0], "QuicSS") == true) { diff --git a/ProxySU/Properties/AssemblyInfo.cs b/ProxySU/Properties/AssemblyInfo.cs index 8899fac..9c8497e 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.4.0.0")] -[assembly: AssemblyFileVersion("2.4.0.0")] +[assembly: AssemblyVersion("2.4.1.0")] +[assembly: AssemblyFileVersion("2.4.1.0")] diff --git a/ProxySU/ResultClientInformation.xaml b/ProxySU/ResultClientInformation.xaml index 83218c0..f42a63a 100644 --- a/ProxySU/ResultClientInformation.xaml +++ b/ProxySU/ResultClientInformation.xaml @@ -13,7 +13,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -106,6 +106,7 @@ + @@ -116,11 +117,15 @@ - - - + + + + + + - + + diff --git a/ProxySU/ResultClientInformation.xaml.cs b/ProxySU/ResultClientInformation.xaml.cs index 16446e2..d07fc5a 100644 --- a/ProxySU/ResultClientInformation.xaml.cs +++ b/ProxySU/ResultClientInformation.xaml.cs @@ -364,10 +364,13 @@ namespace ProxySU TextBoxTrojanGoServerPort.Text = "443"; //密钥(uuid) TextBoxTrojanGoServerPassword.Text = MainWindow.ReceiveConfigurationParameters[2]; + //TrojanGo 使用类型 + TextBoxTrojanGoType.Text = "original"; //WebSocket路径 if (MainWindow.ReceiveConfigurationParameters[0].Equals("TrojanGoWebSocketTLS2Web")) { - TextBoxTrojanGoWSPath.Text = MainWindow.ReceiveConfigurationParameters[3]; + TextBoxTrojanGoType.Text = "ws"; + TextBoxTrojanGoWSPath.Text = MainWindow.ReceiveConfigurationParameters[6]; TextBoxTrojanGoWSPath.Visibility = Visibility.Visible; TextBlockTrojanGoWebSocketPath.Visibility = Visibility.Visible; TextBlockTrojanGoCaption.Visibility = Visibility.Visible; @@ -468,7 +471,7 @@ namespace ProxySU //密码(uuid) TextBoxPasswordSS.Text = MainWindow.ReceiveConfigurationParameters[2]; //加密方式 - TextBoxEncryptionSS.Text = MainWindow.ReceiveConfigurationParameters[6]; + TextBoxEncryptionSS.Text = MainWindow.ReceiveConfigurationParameters[3]; //插件程序 TextBoxPluginNameExplainSS.Text = MainWindow.ReceiveConfigurationParameters[5]; //插件选项 @@ -692,9 +695,9 @@ namespace ProxySU ShowPathV2ray(); TextBoxQuicKeyMkcpSeedPath.Text = MainWindow.ReceiveConfigurationParameters[9]; TextBlockVmessOrVless.Visibility = Visibility.Collapsed; - //隐藏下面的二维码显示,因为V2rayN还未支持TCP Path模式。 - HideGroupBoxClientQRandURL(); - //ShowGroupBoxClientQRandURL(); + //显示下面的二维码显示。 + //HideGroupBoxClientQRandURL(); + ShowGroupBoxClientQRandURL(); } //设置VMess over WS with TLS @@ -1909,26 +1912,16 @@ namespace ProxySU string proxyfolder = CheckDir("trojan-go_config"); configDomainSavePath = CreateConfigSaveDir(proxyfolder, TextBoxTrojanGoServerHost.Text); string configSavePath = configDomainSavePath; - //string saveFileFolderFirst = TextBoxTrojanGoServerHost.Text; - //int num = 1; - //saveFileFolder = saveFileFolderFirst; - //while (Directory.Exists(@"trojan-go_config\" + saveFileFolder)) - //{ - // saveFileFolder = saveFileFolderFirst + "_copy_" + num.ToString(); - // num++; - //} - //CheckDir(@"trojan-go_config\" + saveFileFolder); - string trojanUrl = $"trojan://{TextBoxTrojanGoServerPassword.Text}@{TextBoxTrojanGoServerHost.Text}:{TextBoxTrojanGoServerPort.Text}?allowinsecure=0&tfo=0&sni=&mux=0&ws=0&group=#{TextBoxTrojanGoServerHost.Text}"; - //MessageBox.Show(v2rayNjsonObject.ToString()); - //string trojanUrl = "trojan://" + ToBase64Encode(v2rayNjsonObject.ToString()); - TextBoxURL.Text = trojanUrl; + string trojanGoUrl = GetTrojanGoUrl(); + + TextBoxURL.Text = trojanGoUrl; using (StreamWriter sw = new StreamWriter($"{configSavePath}\\url.txt")) { - sw.WriteLine(trojanUrl); + sw.WriteLine(trojanGoUrl); } - ImageShareQRcode.Source = CreateQRCode(trojanUrl, $"{configSavePath}\\QR.bmp"); + ImageShareQRcode.Source = CreateQRCode(trojanGoUrl, $"{configSavePath}\\QR.bmp"); //移动Trojan官方程序配置文件到相应目录 if (File.Exists(@"trojan-go_config\config.json")) @@ -1956,21 +1949,21 @@ namespace ProxySU sw.WriteLine("-----------------------------------------\n"); sw.WriteLine("QR.bmp"); - //sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)扫码导入节点(Trojan-Go的WebSocket模式暂不支持)"); + //sw.WriteLine("此文件为Qv2ray (windows)、igniter(Android)扫码导入节点"); sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine05").ToString()); - //sw.WriteLine("Trojan-QT5 (windows)下载网址:https://github.com/TheWanderingCoel/Trojan-Qt5/releases"); + //sw.WriteLine("Qv2ray (windows)下载网址:https://github.com/Qv2ray/Qv2ray/releases"); sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine06").ToString()); //sw.WriteLine("igniter(Android)下载网址:https://github.com/trojan-gfw/igniter/releases"); sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine07").ToString()); //sw.WriteLine("Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。"); - sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine08").ToString()); + // sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine08").ToString()); sw.WriteLine("-----------------------------------------\n"); sw.WriteLine("url.txt"); - //sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)复制粘贴导入节点的网址(Trojan-Go的WebSocket模式暂不支持)"); + //sw.WriteLine("此文件为Qv2ray (windows)、igniter(Android)复制粘贴导入节点的网址"); sw.WriteLine(Application.Current.FindResource("readmeTxtTrojan-goExplainLine09").ToString()); sw.WriteLine("-----------------------------------------\n"); @@ -2000,6 +1993,13 @@ namespace ProxySU strParam = TextBoxTrojanGoServerPassword.Text; sw.WriteLine(AlignmentStrFunc(Application.Current.FindResource($"{strApplicat}").ToString(), strLenth) + strParam); + //****** Type: ****** + //sw.WriteLine(Application.Current.FindResource("TextBlockTrojanGoPassword").ToString() + $"{TextBoxTrojanGoServerPassword.Text}"); + //strApplicat = "TextBlockTrojanGoPassword"; + strParam = TextBoxTrojanGoType.Text; + sw.WriteLine(AlignmentStrFunc("Type", strLenth) + strParam); + //sw.WriteLine(AlignmentStrFunc(Application.Current.FindResource($"{strApplicat}").ToString(), strLenth) + strParam); + //****** WebSocket路径: ****** //sw.WriteLine(Application.Current.FindResource("TextBlockTrojanGoWebSocketPath").ToString() + $"{TextBoxTrojanGoWSPath.Text}"); strApplicat = "TextBlockTrojanGoWebSocketPath"; @@ -2009,6 +2009,7 @@ namespace ProxySU } } + #region TrojanGo内容双击复制到剪贴板 private void TextBoxTrojanGoServerHost_MouseDoubleClick(object sender, MouseButtonEventArgs e) { @@ -2024,13 +2025,63 @@ namespace ProxySU { CopyToClipboard(TextBoxTrojanGoServerPassword.Text); } - + private void TextBoxTrojanGoType_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + CopyToClipboard(TextBoxTrojanGoType.Text); + } private void TextBoxTrojanGoWSPath_MouseDoubleClick(object sender, MouseButtonEventArgs e) { CopyToClipboard(TextBoxTrojanGoWSPath.Text); } #endregion + //生成TrojanGo的分享链接 + private string GetTrojanGoUrl() + { + string trojanGoPassword = EncodeURIComponent(TextBoxTrojanGoServerPassword.Text); + string trojanGoHost = TextBoxTrojanGoServerHost.Text; + string trojanGoPort = TextBoxTrojanGoServerPort.Text; + + string trojanGoSni = EncodeURIComponent(trojanGoHost); + string trojanGoType= EncodeURIComponent(TextBoxTrojanGoType.Text); + string trojanGohostName = EncodeURIComponent(trojanGoHost); + + string trojanGoPath = EncodeURIComponent(TextBoxTrojanGoWSPath.Text); + string trojanGoEncryption = EncodeURIComponent(""); + string trojanGoPlugin = EncodeURIComponent(""); + + string trojanGoRemarks = EncodeURIComponent(trojanGoHost); + + //分享链接规范:https://github.com/p4gefau1t/trojan-go/issues/132 + //trojan-go://$(trojan-password)@trojan-host:port/?sni=$(update.microsoft.com)&type=$(original|ws|h2|h2+ws)&host=$(update-01.microsoft.com)&path=$(/update/whatever)&encryption=$(ss;aes-256-gcm:ss-password)&plugin=$(...)#$(descriptive-text) + //string trojanGoUrl = $"trojan-go://{trojanGoPassword}@{trojanGoHost}:{trojanGoPort}/?sni={trojanGoSni}&type={trojanGoType}&host={trojanGohostName}&path={trojanGoPath}&encryption={trojanGoEncryption}&plugin={trojanGoPlugin}#{trojanGoRemarks}"; + + //&path={trojanGoPath} + //&encryption={trojanGoEncryption} + //&plugin={trojanGoPlugin} + //#{trojanGoRemarks} + string trojanGoUrl = $"trojan-go://{trojanGoPassword}@{trojanGoHost}:{trojanGoPort}/?sni={trojanGoSni}&type={trojanGoType}&host={trojanGohostName}"; + + if (String.IsNullOrEmpty(trojanGoPath) == false) + { + trojanGoUrl += $"&path={trojanGoPath}"; + } + if (String.IsNullOrEmpty(trojanGoEncryption) == false) + { + trojanGoUrl += $"&encryption={trojanGoEncryption}"; + } + if (String.IsNullOrEmpty(trojanGoPlugin) == false) + { + trojanGoUrl += $"&plugin={trojanGoPlugin}"; + } + + trojanGoUrl += $"#{trojanGoRemarks}"; + return trojanGoUrl; + } + private string EncodeURIComponent(string initialUri) + { + return Uri.EscapeDataString(initialUri); + } //生成Trojan客户端资料 private void GenerateTrojanShareQRcodeAndBase64Url() @@ -2135,6 +2186,7 @@ namespace ProxySU } } + #region Trojan内容双击复制到剪贴板 private void TextBoxTrojanServerHost_MouseDoubleClick(object sender, MouseButtonEventArgs e) @@ -2246,6 +2298,7 @@ namespace ProxySU } } + #region NaiveProxy内容双击复制到剪贴板 private void TextBoxNaiveServerHost_MouseDoubleClick(object sender, MouseButtonEventArgs e) { @@ -2366,6 +2419,7 @@ namespace ProxySU } } + #region SSR内容双击复制到剪贴板 private void TextBoxSSRHostAddress_MouseDoubleClick(object sender, MouseButtonEventArgs e) @@ -2982,7 +3036,7 @@ namespace ProxySU return spaceString + strTemp; } - + } diff --git a/ProxySU/SSpluginWindow.xaml.cs b/ProxySU/SSpluginWindow.xaml.cs index 70eb2c3..44b1131 100644 --- a/ProxySU/SSpluginWindow.xaml.cs +++ b/ProxySU/SSpluginWindow.xaml.cs @@ -138,7 +138,7 @@ namespace ProxySU //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocketSS.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxWebSocketPathSS.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxWebSocketPathSS.Text.ToString(); } //V2Ray-Plugin SS+WebSocket+TLS+Web模式被选中 @@ -151,7 +151,7 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[8] = RadioButtonWebSocketTLSWebFrontSS.Content.ToString(); //传递路径 - MainWindow.ReceiveConfigurationParameters[3] = TextBoxWebSocketPathSS.Text.ToString(); + MainWindow.ReceiveConfigurationParameters[6] = TextBoxWebSocketPathSS.Text.ToString(); //传递域名 MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomainSS.Text.ToString(); //传递伪装网站 @@ -224,7 +224,7 @@ namespace ProxySU //传递uuid密码 MainWindow.ReceiveConfigurationParameters[2] = TextBoxNewUUIDSS.Text.ToString(); //传递加密方式 - MainWindow.ReceiveConfigurationParameters[6] = GetEncryptionMethodSS(); + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); if (testDomain) { @@ -329,7 +329,7 @@ namespace ProxySU private void ComboBoxEncryptionMethodInfo_SelectionChanged(object sender, SelectionChangedEventArgs e) { //传递加密方式 - MainWindow.ReceiveConfigurationParameters[6] = GetEncryptionMethodSS(); + MainWindow.ReceiveConfigurationParameters[3] = GetEncryptionMethodSS(); } diff --git a/ProxySU/Translations/ProxySU.en-US.xaml b/ProxySU/Translations/ProxySU.en-US.xaml index b6572ab..e7e7dc4 100644 --- a/ProxySU/Translations/ProxySU.en-US.xaml +++ b/ProxySU/Translations/ProxySU.en-US.xaml @@ -364,11 +364,11 @@ Trojan-go official website: https://github.com/p4gefau1t/trojan-go Trojan-go official program download address: https://github.com/p4gefau1t/trojan-go/releases Download the corresponding version, select Trojan-go-x.xx-win.zip for Windows, extract trojan-go.exe after decompression. Put it in the same directory as config.json, just run trojan-go.exe. - This file is for Trojan-QT5 (windows), ignore (Android), Shadowrocket (ios) scan code import node (Trojan-Go’s WebSocket mode is not currently supported) - Trojan-QT5 (windows) download URL: https://github.com/TheWanderingCoel/Trojan-Qt5/releases + This file is for Qv2ray (windows), ignore (Android) scan code import node + Qv2ray (windows) download URL: https://github.com/Qv2ray/Qv2ray/releases igniter (Android) download URL: https://github.com/trojan-gfw/igniter/releases Shadowrocket(ios) download, you need to use the AppleID of the foreign region. Please Google method yourself. - This file is Trojan-QT5 (windows), ignore (Android), Shadowrocket (ios) copy and paste the URL of the imported node (Trojan-Go’s WebSocket mode is not currently supported) + This file is Qv2ray (windows), ignore (Android)copy and paste the URL of the imported node Server general connection configuration parameters This file is the client configuration file used by the official Trojan program. It is configured in global mode, http and socks5 address: 127.0.0.1:1080 diff --git a/ProxySU/Translations/ProxySU.zh-CN.xaml b/ProxySU/Translations/ProxySU.zh-CN.xaml index 9148044..ee51459 100644 --- a/ProxySU/Translations/ProxySU.zh-CN.xaml +++ b/ProxySU/Translations/ProxySU.zh-CN.xaml @@ -373,11 +373,11 @@ Trojan-go官方网站:https://github.com/p4gefau1t/trojan-go Trojan-go官方程序下载地址:https://github.com/p4gefau1t/trojan-go/releases 下载相应版本,Windows选择Trojan-go-x.xx-win.zip,解压后提取trojan-go.exe。与config.json放在同一目录,运行trojan-go.exe即可。 - 此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)扫码导入节点(Trojan-Go的WebSocket模式暂不支持) - Trojan-QT5 (windows)下载网址:https://github.com/TheWanderingCoel/Trojan-Qt5/releases + 此文件为Qv2ray (windows)、igniter(Android)扫码导入节点 + Qv2ray (windows)下载网址:https://github.com/Qv2ray/Qv2ray/releases igniter(Android)下载网址:https://github.com/trojan-gfw/igniter/releases Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。 - 此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)复制粘贴导入节点的网址(Trojan-Go的WebSocket模式暂不支持) + 此文件为Qv2ray (windows)、igniter(Android)复制粘贴导入节点的网址 服务器通用连接配置参数 此文件为Trojan官方程序所使用的客户端配置文件,配置为全局模式,http与socks5地址:127.0.0.1:1080 diff --git a/ProxySU/Translations/ProxySU.zh-TW.xaml b/ProxySU/Translations/ProxySU.zh-TW.xaml index 262e604..a6b3585 100644 --- a/ProxySU/Translations/ProxySU.zh-TW.xaml +++ b/ProxySU/Translations/ProxySU.zh-TW.xaml @@ -367,11 +367,11 @@ Trojan-go官方網站:https://github.com/p4gefau1t/trojan-go Trojan-go官方程序下載地址:https://github.com/p4gefau1t/trojan-go/releases 下載相應版本,Windows選擇Trojan-go-x.xx-win.zip,解壓後提取trojan-go.exe。與config.json放在同一目錄,運行trojan-go.exe即可。 - 此文件為Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)掃碼導入節點(Trojan-Go的WebSocket模式暫不支持) - Trojan-QT5 (windows)下載網址:https://github.com/TheWanderingCoel/Trojan-Qt5/releases + 此文件為Qv2ray (windows)、igniter(Android)掃碼導入節點 + Qv2ray (windows)下載網址:https://github.com/Qv2ray/Qv2ray/releases igniter(Android)下載網址:https://github.com/trojan-gfw/igniter/releases Shadowrocket(ios)下載,需要使用國外區的AppleID。請自行谷歌方法。 - 此文件為Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)複製粘貼導入節點的網址(Trojan-Go的WebSocket模式暫不支持) + 此文件為Qv2ray (windows)、igniter(Android)複製粘貼導入節點的網址 服務器通用連接配置參數 此文件為Trojan官方程序所使用的客戶端配置文件,配置為全局模式,http與socks5地址:127.0.0.1:1080 diff --git a/ProxySU/TrojanGoTemplateWindow.xaml b/ProxySU/TrojanGoTemplateWindow.xaml index 31de2ad..948de9a 100644 --- a/ProxySU/TrojanGoTemplateWindow.xaml +++ b/ProxySU/TrojanGoTemplateWindow.xaml @@ -88,7 +88,7 @@ - + diff --git a/ProxySU/TrojanGoTemplateWindow.xaml.cs b/ProxySU/TrojanGoTemplateWindow.xaml.cs index 4be8596..6f6cebb 100644 --- a/ProxySU/TrojanGoTemplateWindow.xaml.cs +++ b/ProxySU/TrojanGoTemplateWindow.xaml.cs @@ -68,7 +68,8 @@ namespace ProxySU MainWindow.ReceiveConfigurationParameters[0] = "TrojanGoWebSocketTLS2Web"; //传递方案名称 MainWindow.ReceiveConfigurationParameters[8] = RadioButtonTrojanGoWebSocketTLS2Web.Content.ToString(); - MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text; + //传递路径 + MainWindow.ReceiveConfigurationParameters[6] = TextBoxPath.Text; } this.Close(); @@ -76,25 +77,19 @@ namespace ProxySU //更新密码 private void ButtonNewUUID_Click(object sender, RoutedEventArgs e) { - Guid uuid = Guid.NewGuid(); - TextBoxNewUUID.Text = uuid.ToString(); + //Guid uuid = Guid.NewGuid(); + TextBoxNewUUID.Text = GenerateRandomUUID(); } //更新路径 private void ButtonPath_Click(object sender, RoutedEventArgs e) { - Random random = new Random(); - int randomSerialNum = random.Next(0, 4); - Guid uuid = Guid.NewGuid(); - string[] pathArray = uuid.ToString().Split('-'); - string path = pathArray[randomSerialNum]; + string path = GenerateRandomPath(); TextBoxPath.Text = $"/{path}"; //MessageBox.Show(path); } //private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e) //{ - // Random random = new Random(); - // int randomServerPort = random.Next(10000, 50000); - // TextBoxServerListenPort.Text = randomServerPort.ToString(); + // TextBoxServerListenPort.Text = GetRandomPort(); //} private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close(); @@ -118,8 +113,45 @@ namespace ProxySU ButtonPath.Visibility = Visibility.Visible; TextBoxPath.Text = "/trojan"; } - - + //生成随机UUID + private string GenerateRandomUUID() + { + Guid uuid = Guid.NewGuid(); + return uuid.ToString(); + } + + //生成随机端口 + private int GetRandomPort() + { + Random random = new Random(); + return random.Next(10001, 60000); + } + //生成随机Path + private string GenerateRandomPath() + { + Random random = new Random(); + int randomSerialNum = random.Next(0, 4); + //Guid uuid = Guid.NewGuid(); + string uuid = GenerateRandomUUID(); + string[] pathArray = uuid.Split('-'); + string path = pathArray[randomSerialNum]; + return path; + } + //域名检测是否为空 + private bool TestDomainIsEmpty() + { + if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true) + { + //****** "域名不能为空,请检查相关参数设置!" ****** + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_DomainNotEmpty").ToString()); + return false; + } + else + { + return true; + } + } + } } diff --git a/ProxySU/V2RayTemplateWindow.xaml.cs b/ProxySU/V2RayTemplateWindow.xaml.cs index 80e45b7..270d507 100644 --- a/ProxySU/V2RayTemplateWindow.xaml.cs +++ b/ProxySU/V2RayTemplateWindow.xaml.cs @@ -1020,21 +1020,18 @@ namespace ProxySU //产生随机的uuid private void ButtonNewUUID_Click(object sender, RoutedEventArgs e) { - //Guid uuid = Guid.NewGuid(); TextBoxNewUUID.Text = GenerateRandomUUID(); } //产生QUIC密钥/mKCP Seed所用的UUID private void ButtonQuicAndMkcpSeedUUID_Click(object sender, RoutedEventArgs e) { - //Guid uuid = Guid.NewGuid(); TextBoxQuicAndMkcpSeedUUID.Text = GenerateRandomUUID(); } //更新随机服务端口 private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e) { - //Random random = new Random(); int randomServerPort = GetRandomPort(); TextBoxServerListenPort.Text = randomServerPort.ToString(); } @@ -1042,13 +1039,8 @@ namespace ProxySU //更新单方案随机的Path private void ButtonPath_Click(object sender, RoutedEventArgs e) { - //Random random = new Random(); - //int randomSerialNum = random.Next(0, 4); - //Guid uuid = Guid.NewGuid(); - //string[] pathArray = uuid.ToString().Split('-'); string path = GenerateRandomPath(); TextBoxPath.Text = $"/{path}"; - //MessageBox.Show(path); } //更新多方案共存的Path @@ -1124,11 +1116,6 @@ namespace ProxySU //读取加密方式 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) diff --git a/ProxySU/bin/Beta/Beta.zip b/ProxySU/bin/Beta/Beta.zip index e09d696..97dd6ae 100644 Binary files a/ProxySU/bin/Beta/Beta.zip and b/ProxySU/bin/Beta/Beta.zip differ