1
0
Fork 0
mirror of https://github.com/proxysu/ProxySU.git synced 2025-04-10 12:40:55 +00:00

Merge pull request #3 from proxysu/master

update
This commit is contained in:
xnxy2012 2021-05-07 15:54:13 +08:00 committed by GitHub
commit 496684fbe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 2529 additions and 1074 deletions

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProxySU_Core.Models
{
public class AppSettings
{
public string Language { get; set; }
}
}

View file

@ -25,20 +25,20 @@ namespace ProxySU_Core.Models.Developers
private const string ServerReverseDir = @"Templates\xray\server\09_reverse";
private const string CaddyFileDir = @"Templates\xray\caddy";
public const int VLESS_TCP_Port = 1110;
public const int VLESS_WS_Port = 1111;
public const int VLESS_H2_Port = 1112;
public const int VLESS_mKCP_Port = 1113;
public static int VLESS_TCP_Port = 1110;
public static int VLESS_WS_Port = 1111;
public static int VLESS_H2_Port = 1112;
public static int VLESS_mKCP_Port = 1113;
public const int VMESS_TCP_Port = 2110;
public const int VMESS_WS_Port = 2111;
public const int VMESS_H2_Port = 2112;
public const int VMESS_mKCP_Port = 2113;
public static int VMESS_TCP_Port = 1210;
public static int VMESS_WS_Port = 1211;
public static int VMESS_H2_Port = 1212;
public const int Trojan_TCP_Port = 3110;
public const int Trojan_WS_Port = 3111;
public static int Trojan_TCP_Port = 1310;
public static int Trojan_WS_Port = 1311;
public static int FullbackPort = 8080;
public const int ShadowSocksPort = 4110;
public static dynamic LoadXrayConfig()
@ -73,6 +73,8 @@ namespace ProxySU_Core.Models.Developers
{
var caddyStr = File.ReadAllText(Path.Combine(CaddyFileDir, "base.caddyfile"));
caddyStr = caddyStr.Replace("##domain##", parameters.Domain);
caddyStr = caddyStr.Replace("##port##", FullbackPort.ToString());
if (!useCustomWeb && !string.IsNullOrEmpty(parameters.MaskDomain))
{
var prefix = "http://";
@ -101,7 +103,7 @@ namespace ProxySU_Core.Models.Developers
baseBound.port = parameters.Port;
baseBound.settings.fallbacks.Add(JToken.FromObject(new
{
dest = 80
dest = FullbackPort
}));
xrayConfig.inbounds.Add(baseBound);
baseBound.settings.clients[0].id = parameters.UUID;
@ -121,6 +123,25 @@ namespace ProxySU_Core.Models.Developers
xrayConfig.inbounds.Add(JToken.FromObject(wsInbound));
}
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
{
var gRPCInBound = GetBound("VLESS_gRPC.json");
gRPCInBound.port = parameters.VLESS_gRPC_Port;
gRPCInBound.settings.clients[0].id = parameters.UUID;
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
}
if (parameters.Types.Contains(XrayType.VLESS_KCP))
{
var kcpBound = GetBound("VLESS_KCP.json");
kcpBound.port = parameters.VLESS_KCP_Port;
kcpBound.settings.clients[0].id = parameters.UUID;
kcpBound.streamSettings.kcpSettings.header.type = parameters.VLESS_KCP_Type;
kcpBound.streamSettings.kcpSettings.seed = parameters.VLESS_KCP_Seed;
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
}
if (parameters.Types.Contains(XrayType.VMESS_TCP))
{
var mtcpBound = GetBound("VMESS_TCP.json");
@ -151,11 +172,22 @@ namespace ProxySU_Core.Models.Developers
xrayConfig.inbounds.Add(JToken.FromObject(mwsBound));
}
if (parameters.Types.Contains(XrayType.VMESS_KCP))
{
var kcpBound = GetBound("VMESS_KCP.json");
kcpBound.port = parameters.VMESS_KCP_Port;
kcpBound.settings.clients[0].id = parameters.UUID;
kcpBound.streamSettings.kcpSettings.header.type = parameters.VMESS_KCP_Type;
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
}
if (parameters.Types.Contains(XrayType.Trojan_TCP))
{
var trojanTcpBound = GetBound("Trojan_TCP.json");
trojanTcpBound.port = Trojan_TCP_Port;
trojanTcpBound.settings.clients[0].password = parameters.TrojanPassword;
trojanTcpBound.settings.fallbacks[0].dest = FullbackPort;
baseBound.settings.fallbacks[0] = JToken.FromObject(new
{
dest = Trojan_TCP_Port,
@ -164,21 +196,11 @@ namespace ProxySU_Core.Models.Developers
xrayConfig.inbounds.Add(JToken.FromObject(trojanTcpBound));
}
if (parameters.Types.Contains(XrayType.VMESS_KCP))
{
var kcpBound = GetBound("VMESS_KCP.json");
kcpBound.port = VMESS_mKCP_Port;
kcpBound.settings.clients[0].id = parameters.UUID;
kcpBound.streamSettings.kcpSettings.header.type = parameters.VMESS_KCP_Type;
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
}
if (parameters.Types.Contains(XrayType.ShadowsocksAEAD))
{
var ssBound = GetBound("Shadowsocks-AEAD.json");
ssBound.port = ShadowSocksPort;
ssBound.port = parameters.ShadowSocksPort;
ssBound.settings.clients[0].password = parameters.ShadowsocksPassword;
ssBound.settings.clients[0].method = parameters.ShadowsocksMethod;
xrayConfig.inbounds.Add(JToken.FromObject(ssBound));

View file

@ -8,6 +8,14 @@ namespace ProxySU_Core.Models.Developers
{
int Port { get; set; }
int VLESS_gRPC_Port { get; set; }
int VLESS_KCP_Port { get; set; }
int VMESS_KCP_Port { get; set; }
int ShadowSocksPort { get; set; }
string Domain { get; set; }
List<XrayType> Types { get; set; }

View file

@ -308,12 +308,22 @@ namespace ProxySU_Core.Models.Developers
if (Parameters.Types.Contains(XrayType.ShadowsocksAEAD))
{
portList.Add(ConfigBuilder.ShadowSocksPort);
portList.Add(Parameters.ShadowSocksPort);
}
if (Parameters.Types.Contains(XrayType.VMESS_KCP))
{
portList.Add(ConfigBuilder.VMESS_mKCP_Port);
portList.Add(Parameters.VMESS_KCP_Port);
}
if (Parameters.Types.Contains(XrayType.VLESS_KCP))
{
portList.Add(Parameters.VLESS_KCP_Port);
}
if (Parameters.Types.Contains(XrayType.VLESS_gRPC))
{
portList.Add(Parameters.VLESS_gRPC_Port);
}
OpenPort(portList.ToArray());
@ -400,6 +410,7 @@ namespace ProxySU_Core.Models.Developers
RunCmd("curl -o caddy_install.sh https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh");
RunCmd("yes | bash caddy_install.sh");
RunCmd("rm -rf caddy_install.sh");
RunCmd("systemctl enable caddy.service");
}
protected void UninstallCaddy()
@ -468,7 +479,7 @@ namespace ProxySU_Core.Models.Developers
return true;
}
public void ConfigurePort(bool force = true)
public void ConfigurePort()
{
if (Parameters.Port == 80 || Parameters.Port == 443)
{
@ -480,6 +491,9 @@ namespace ProxySU_Core.Models.Developers
SetPortFree(80);
SetPortFree(443);
SetPortFree(Parameters.Port);
SetPortFree(Parameters.VLESS_gRPC_Port);
SetPortFree(Parameters.VLESS_KCP_Port);
SetPortFree(Parameters.ShadowSocksPort);
}
}

View file

@ -87,7 +87,6 @@ namespace ProxySU_Core.Models.Developers
WriteOutput("启动BBR");
EnableBBR();
WriteOutput("BBR启动成功");
UploadCaddyFile();
WriteOutput("************");
@ -102,7 +101,7 @@ namespace ProxySU_Core.Models.Developers
}
}
public void Uninstall()
public void UninstallProxy()
{
EnsureRootAuth();
WriteOutput("卸载Caddy");
@ -112,7 +111,7 @@ namespace ProxySU_Core.Models.Developers
WriteOutput("卸载证书");
UninstallAcme();
WriteOutput("关闭端口");
ClosePort(ConfigBuilder.ShadowSocksPort, ConfigBuilder.VLESS_mKCP_Port, ConfigBuilder.VMESS_mKCP_Port);
ClosePort(Parameters.ShadowSocksPort, Parameters.VMESS_KCP_Port);
WriteOutput("************ 卸载完成 ************");
}
@ -141,6 +140,8 @@ namespace ProxySU_Core.Models.Developers
var stream = new MemoryStream(Encoding.UTF8.GetBytes(configJson));
RunCmd("rm -rf /usr/local/etc/xray/config.json");
UploadFile(stream, "/usr/local/etc/xray/config.json");
ConfigurePort();
UploadCaddyFile(string.IsNullOrEmpty(Parameters.MaskDomain));
RunCmd("systemctl restart xray");
WriteOutput("************ 更新Xray配置成功更新配置不包含域名如果域名更换请重新安装。 ************");
}
@ -148,13 +149,11 @@ namespace ProxySU_Core.Models.Developers
/// <summary>
/// 重装Caddy
/// </summary>
public void ReinstallCaddy()
public void DoUninstallCaddy()
{
EnsureRootAuth();
EnsureSystemEnv();
InstallCaddy();
UploadCaddyFile();
WriteOutput("************ 重装Caddy完成 ************");
UninstallCaddy();
WriteOutput("************ 卸载Caddy完成 ************");
}
/// <summary>
@ -268,6 +267,7 @@ namespace ProxySU_Core.Models.Developers
{
RemoveNat64();
}
WriteOutput("BBR启动成功");
}
if (!canInstallBBR)
@ -382,14 +382,14 @@ namespace ProxySU_Core.Models.Developers
result = RunCmd(cmd);
}
if (result.Contains("Cert success"))
if (result.Contains("success"))
{
WriteOutput("申请证书成功");
}
else
{
WriteOutput("申请证书失败,联系开发者!");
throw new Exception("申请证书失败,联系开发者!");
WriteOutput("申请证书失败,如果申请次数过多请更换二级域名,或联系开发者!");
throw new Exception("申请证书失败,如果申请次数过多请更换二级域名,或联系开发者!");
}
// 安装证书到xray

View file

@ -20,6 +20,8 @@ namespace ProxySU_Core.Models
case XrayType.VLESS_TCP:
case XrayType.VLESS_TCP_XTLS:
case XrayType.VLESS_WS:
case XrayType.VLESS_KCP:
case XrayType.VLESS_gRPC:
case XrayType.Trojan_TCP:
return BuildVlessShareLink(xrayType, settings);
case XrayType.VMESS_TCP:
@ -38,10 +40,10 @@ namespace ProxySU_Core.Models
var _method = settings.ShadowsocksMethod;
var _password = settings.ShadowsocksPassword;
var _server = settings.Domain;
var _port = ConfigBuilder.ShadowSocksPort;
var _port = settings.ShadowSocksPort;
var base64URL = Base64.Encode($"{_method}:{_password}@{_server}:{_port}");
return "ss://" + base64URL;
return "ss://" + base64URL + "#ShadowSocks";
}
private static string BuildVmessShareLink(XrayType xrayType, XraySettings settings)
@ -77,7 +79,7 @@ namespace ProxySU_Core.Models
break;
case XrayType.VMESS_KCP:
vmess.ps = "vmess-mKCP";
vmess.port = ConfigBuilder.VMESS_mKCP_Port.ToString();
vmess.port = settings.VMESS_KCP_Port.ToString();
vmess.net = "kcp";
vmess.type = settings.VMESS_KCP_Type;
vmess.path = settings.VMESS_KCP_Seed;
@ -98,47 +100,47 @@ namespace ProxySU_Core.Models
var _domain = settings.Domain;
var _port = settings.Port;
var _type = string.Empty;
var _encryption = string.Empty;
var _encryption = "none";
var _security = "tls";
var _path = "/";
var _host = settings.Domain;
var _descriptiveText = string.Empty;
var _headerType = "none";
var _seed = string.Empty;
switch (xrayType)
{
case XrayType.VLESS_TCP:
_protocol = "vless";
_type = "tcp";
_encryption = "none";
_descriptiveText = "vless-tcp-tls";
break;
case XrayType.VLESS_TCP_XTLS:
_protocol = "vless";
_type = "tcp";
_security = "xtls";
_encryption = "none";
_descriptiveText = "vless-tcp-xtls";
break;
case XrayType.VLESS_WS:
_protocol = "vless";
_type = "ws";
_path = settings.VLESS_WS_Path;
_encryption = "none";
_descriptiveText = "vless-ws-tls";
break;
case XrayType.VMESS_TCP:
_protocol = "vmess";
_type = "tcp";
_path = settings.VMESS_TCP_Path;
_encryption = "auto";
_descriptiveText = "vmess-tcp-tls";
case XrayType.VLESS_KCP:
_protocol = "vless";
_type = "kcp";
_headerType = settings.VLESS_KCP_Type;
_seed = settings.VLESS_KCP_Seed;
_port = settings.VLESS_KCP_Port;
_security = "none";
_descriptiveText = "vless-mKCP";
break;
case XrayType.VMESS_WS:
_protocol = "vmess";
_type = "ws";
_path = settings.VMESS_WS_Path;
_encryption = "auto";
_descriptiveText = "vmess-ws-tls";
case XrayType.VLESS_gRPC:
_protocol = "vless";
_type = "grpc";
_path = settings.VLESS_gRPC_ServiceName;
_descriptiveText = "vless-gRPC";
break;
case XrayType.Trojan_TCP:
_protocol = "trojan";
@ -154,11 +156,13 @@ namespace ProxySU_Core.Models
if (xrayType != XrayType.Trojan_TCP)
{
// 4.3 传输层相关段
parametersURL = $"?type={_type}&encryption={_encryption}&security={_security}&host={_host}&path={HttpUtility.UrlEncode(_path)}";
parametersURL = $"?type={_type}&encryption={_encryption}&security={_security}&path={HttpUtility.UrlEncode(_path)}&headerType={_headerType}";
// if mKCP
// if QUIC
// kcp
if (xrayType == XrayType.VLESS_KCP)
{
parametersURL += $"&seed={_seed}";
}
// 4.4 TLS 相关段
if (xrayType == XrayType.VLESS_TCP_XTLS)

View file

@ -17,11 +17,19 @@ namespace ProxySU_Core.Models
{
var guid = Guid.NewGuid().ToString();
Port = 443;
VLESS_KCP_Port = 2001;
VLESS_gRPC_Port = 2002;
VMESS_KCP_Port = 3001;
ShadowSocksPort = 4001;
UUID = guid;
Types = new List<XrayType>();
VLESS_WS_Path = "/vlessws";
VLESS_H2_Path = "/vlessh2";
VLESS_KCP_Type = "none";
VLESS_KCP_Seed = guid;
VLESS_gRPC_ServiceName = "xray_gRPC";
VMESS_WS_Path = "/vmessws";
VMESS_TCP_Path = "/vmesstcp";
@ -41,12 +49,15 @@ namespace ProxySU_Core.Models
/// </summary>
public int Port { get; set; }
/// <summary>
/// UUID
/// </summary>
public string UUID { get; set; }
#region vless
/// <summary>
/// vless ws路径
/// </summary>
@ -56,6 +67,32 @@ namespace ProxySU_Core.Models
/// vless http2 path
/// </summary>
public string VLESS_H2_Path { get; set; }
/// <summary>
/// vless kcp seed
/// </summary>
public string VLESS_KCP_Seed { get; set; }
/// <summary>
/// vless kcp type
/// </summary>
public string VLESS_KCP_Type { get; set; }
/// <summary>
/// vless kcp端口
/// </summary>
public int VLESS_KCP_Port { get; set; }
/// <summary>
/// grpc service name
/// </summary>
public string VLESS_gRPC_ServiceName { get; set; }
/// <summary>
/// grpc port
/// </summary>
public int VLESS_gRPC_Port { get; set; }
#endregion
#region vmess
@ -83,6 +120,11 @@ namespace ProxySU_Core.Models
/// vmess kcp type
/// </summary>
public string VMESS_KCP_Type { get; set; }
/// <summary>
/// vmess kcp端口
/// </summary>
public int VMESS_KCP_Port { get; set; }
#endregion
#region Trojan
@ -107,6 +149,11 @@ namespace ProxySU_Core.Models
/// ss method
/// </summary>
public string ShadowsocksMethod { get; set; }
/// <summary>
/// ss端口
/// </summary>
public int ShadowSocksPort { get; set; }
#endregion
@ -157,28 +204,4 @@ namespace ProxySU_Core.Models
}
public enum XrayType
{
// 入口
VLESS_TCP_XTLS = 100,
// vless 101开头
VLESS_TCP = 101,
VLESS_WS = 102,
VLESS_H2 = 103,
VLESS_KCP = 104,
// vmess 201开头
VMESS_TCP = 201,
VMESS_WS = 202,
VMESS_H2 = 203,
VMESS_KCP = 204,
// trojan 301开头
Trojan_TCP = 301,
Trojan_WS = 302,
// ss
ShadowsocksAEAD = 401
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProxySU_Core.Models
{
public enum XrayType
{
// 入口
VLESS_TCP_XTLS = 100,
// VLESS 101开头
VLESS_TCP = 101,
VLESS_WS = 102,
VLESS_H2 = 103,
VLESS_KCP = 104,
VLESS_gRPC = 110,
// VMESS 201开头
VMESS_TCP = 201,
VMESS_WS = 202,
VMESS_H2 = 203,
VMESS_KCP = 204,
// Trojan 301开头
Trojan_TCP = 301,
Trojan_WS = 302,
// SS
ShadowsocksAEAD = 401
}
}

View file

@ -51,5 +51,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.1.3.0")]
[assembly: AssemblyFileVersion("3.1.3.0")]

View file

@ -89,6 +89,9 @@
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="QRCoder, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\QRCoder.1.4.1\lib\net40\QRCoder.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet, Version=2020.0.1.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
<HintPath>..\packages\SSH.NET.2020.0.1\lib\net40\Renci.SshNet.dll</HintPath>
</Reference>
@ -96,6 +99,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
@ -123,12 +127,15 @@
<Compile Include="Common\Base64.cs" />
<Compile Include="Converters\LoginSecretTypeConverter.cs" />
<Compile Include="Converters\VisibleConverter.cs" />
<Compile Include="Models\AppSettings.cs" />
<Compile Include="Models\Host.cs" />
<Compile Include="Models\ShareLink.cs" />
<Compile Include="Models\XraySettings.cs" />
<Compile Include="Models\XrayType.cs" />
<Compile Include="Tools\DateTimeUtils.cs" />
<Compile Include="Tools\Extensions.cs" />
<Compile Include="ViewModels\BaseCommand.cs" />
<Compile Include="ViewModels\BaseModel.cs" />
<Compile Include="ViewModels\BaseViewModel.cs" />
<Compile Include="Models\Developers\ConfigBuilder.cs" />
<Compile Include="Models\Developers\IParameters.cs" />
@ -143,15 +150,51 @@
<Compile Include="ViewModels\RecordViewModel.cs" />
<Compile Include="ViewModels\Terminal.cs" />
<Compile Include="ViewModels\XraySettingsViewModel.cs" />
<Compile Include="Views\ClientInfoWindow.xaml.cs">
<Compile Include="Views\ClientInfo\ClientInfoWindow.xaml.cs">
<DependentUpon>ClientInfoWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\ShadowSocksControl.xaml.cs">
<DependentUpon>ShadowSocksControl.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\Trojan_TCP_Control.xaml.cs">
<DependentUpon>Trojan_TCP_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_gRPC_Control.xaml.cs">
<DependentUpon>VLESS_gRPC_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_KCP_Control.xaml.cs">
<DependentUpon>VLESS_KCP_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_TCP_TLS_Control.xaml.cs">
<DependentUpon>VLESS_TCP_TLS_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_WS_TLS_Control.xaml.cs">
<DependentUpon>VLESS_WS_TLS_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_XTLS_Control.xaml.cs">
<DependentUpon>VLESS_XTLS_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VMESS_KCP_Control.xaml.cs">
<DependentUpon>VMESS_KCP_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VMESS_TCP_TLS_Control.xaml.cs">
<DependentUpon>VMESS_TCP_TLS_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VMESS_WS_TLS_Control.xaml.cs">
<DependentUpon>VMESS_WS_TLS_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\RecordEditorWindow.xaml.cs">
<Compile Include="Views\RecordEditor\RecordEditorWindow.xaml.cs">
<DependentUpon>RecordEditorWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\RecordEditor\ServerInfoControl.xaml.cs">
<DependentUpon>ServerInfoControl.xaml</DependentUpon>
</Compile>
<Compile Include="Views\RecordEditor\XrayEditorControl.xaml.cs">
<DependentUpon>XrayEditorControl.xaml</DependentUpon>
</Compile>
<Compile Include="Views\TerminalWindow.xaml.cs">
<DependentUpon>TerminalWindow.xaml</DependentUpon>
</Compile>
@ -252,6 +295,9 @@
<None Include="Templates\xray\server\05_inbounds\Trojan_WS.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\xray\server\05_inbounds\VLESS_gRPC.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\xray\server\05_inbounds\VLESS_HTTP2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@ -305,7 +351,47 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\ClientInfoWindow.xaml">
<Page Include="Views\ClientInfo\ClientInfoWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\ShadowSocksControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\Trojan_TCP_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_gRPC_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_KCP_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_TCP_TLS_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_WS_TLS_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_XTLS_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VMESS_KCP_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VMESS_TCP_TLS_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VMESS_WS_TLS_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -313,7 +399,15 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\RecordEditorWindow.xaml">
<Page Include="Views\RecordEditor\RecordEditorWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\RecordEditor\ServerInfoControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\RecordEditor\XrayEditorControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View file

@ -2,11 +2,31 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<sys:String x:Key="TabItemHeaderAppDeployment">Deployment</sys:String>
<sys:String x:Key="LanguageText">Language</sys:String>
<sys:String x:Key="TabItemHeaderReadme">Readme</sys:String>
<sys:String x:Key="LanguageText">Language(语言)</sys:String>
<sys:String x:Key="LanguageChinese">Chinese</sys:String>
<sys:String x:Key="LanguageEnglish">English</sys:String>
<sys:String x:Key="Hosts">Hosts</sys:String>
<sys:String x:Key="AddHost">Add Host</sys:String>
<sys:String x:Key="ViewConfig">Export Config</sys:String>
<sys:String x:Key="ViewSub">Export Sub</sys:String>
<sys:String x:Key="Random">Random</sys:String>
<!--table-->
<sys:String x:Key="MainTableSelection">Selection</sys:String>
<sys:String x:Key="MainTableRemark">Remark</sys:String>
<sys:String x:Key="MainTableHost">Host</sys:String>
<sys:String x:Key="MainTablePort">Port</sys:String>
<sys:String x:Key="MainTableProxy">Proxy</sys:String>
<sys:String x:Key="MainTableActions">Actions</sys:String>
<sys:String x:Key="MainTableControl">Cnsole</sys:String>
<sys:String x:Key="MainTableViewConfig">Config</sys:String>
<sys:String x:Key="MainTableEditor">Edit</sys:String>
<sys:String x:Key="MainTableDelete">Delete</sys:String>
<sys:String x:Key="Actions">Actions</sys:String>
<sys:String x:Key="Connect">Connect</sys:String>
<sys:String x:Key="Edit">Edit</sys:String>
@ -14,12 +34,14 @@
<sys:String x:Key="Delete">Delete</sys:String>
<sys:String x:Key="Install">Install</sys:String>
<sys:String x:Key="Save">Save</sys:String>
<sys:String x:Key="SaveAs">Save as</sys:String>
<sys:String x:Key="Info">Info</sys:String>
<sys:String x:Key="Warning">Warning</sys:String>
<sys:String x:Key="Error">Error</sys:String>
<!--Host Window-->
<sys:String x:Key="HostWindowTitle">Server Manager</sys:String>
<sys:String x:Key="HostWindowTitle">Server Editor</sys:String>
<sys:String x:Key="ConnectionGroupName">Connection</sys:String>
<sys:String x:Key="HostUserName">User</sys:String>
<sys:String x:Key="HostPassword">Password</sys:String>
@ -44,6 +66,57 @@
<sys:String x:Key="HostPortNotNull">Please enter port</sys:String>
<sys:String x:Key="PorxyAddressNotNull">Please enter proxy host</sys:String>
<sys:String x:Key="ProxyProtNotNull">Please enter proxy port</sys:String>
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS over TCP With XTLS&#x0a;Preferred</sys:String>
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS&#x0a;XTLS is Preferred</sys:String>
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS&#x0a;Support CDN</sys:String>
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP&#x0a;low delay</sys:String>
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS&#x0a;Support CDN</sys:String>
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP&#x0a;low delay</sys:String>
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks&#x0a;Support CDN</sys:String>
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS&#x0a;Trojan</sys:String>
<sys:String x:Key="XrayDomain">Address</sys:String>
<sys:String x:Key="XrayMarkDomain">GuiseHost</sys:String>
<sys:String x:Key="XrayUUID">UUID</sys:String>
<sys:String x:Key="VlessWsPath">VLESS WS Path</sys:String>
<sys:String x:Key="VlessKcpSeed">VLESS KCP Seed</sys:String>
<sys:String x:Key="VlessKcpType">VLESS KCP Type</sys:String>
<sys:String x:Key="VlessKcpPort">VLESS KCP Port</sys:String>
<sys:String x:Key="VmessWsPath">VMESS WS Path</sys:String>
<sys:String x:Key="VmessKcpSeed">VMESS KCP Seed</sys:String>
<sys:String x:Key="VmessKcpType">VMESS KCP Type</sys:String>
<sys:String x:Key="VmessKcpPort">VMESS KCP Port</sys:String>
<sys:String x:Key="SSPassword">SS Pwd</sys:String>
<sys:String x:Key="SSMethods">SS Method</sys:String>
<sys:String x:Key="TrojanPassword">Trojan Pwd</sys:String>
<sys:String x:Key="XrayPort">xray Port</sys:String>
<sys:String x:Key="XrayPortDefault">default port is 443</sys:String>
<!--Terminal Window-->
<sys:String x:Key="TerminalTitle">Console</sys:String>
<sys:String x:Key="InstallActions">xray/settings</sys:String>
<sys:String x:Key="InstallXray">Install</sys:String>
<sys:String x:Key="UpdateSettings">UpdateSettings</sys:String>
<sys:String x:Key="UpdateXrayCore">UpdateXray</sys:String>
<sys:String x:Key="UninstallXray">UninstallXray</sys:String>
<sys:String x:Key="SettingActions">cert/web</sys:String>
<sys:String x:Key="UpdateCert">UpdateCert</sys:String>
<sys:String x:Key="UploadSelfCert">UploadSelfCert</sys:String>
<sys:String x:Key="UploadWeb">UploadWebite</sys:String>
<sys:String x:Key="UninstallCaddy">UninstallCaddy</sys:String>
<sys:String x:Key="ReadmeInstallXray">Install: Finally output "please enjoy" to indicate completion, go to [Configuration] or [Config] to view the node</sys:String>
<sys:String x:Key="ReadmeUpdateSettings">Update Settings: After modifying the node configuration information, there is no need to reinstall, this function can update the configuration</sys:String>
<sys:String x:Key="ReadmeUpdateCert">Update Cert: The certificate is automatically updated by default, but it is not guaranteed to be updated successfully. If it fails, please use [Update Cert] to update manually</sys:String>
<sys:String x:Key="ReadmeUploadWeb">Upload website: Disguise the website, the correct static webpage must have an index.html file (please check), and then upload the website compressed package.</sys:String>
<sys:String x:Key="ReadmeWebsiteDemo">The following is a static web page connection provided by netizens, please check whether there is an index.html file by yourself</sys:String>
<!--client info window-->
<sys:String x:Key="ClientInfoTitle">View Settings</sys:String>
</ResourceDictionary>

View file

@ -2,18 +2,37 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<sys:String x:Key="TabItemHeaderAppDeployment">应用布署</sys:String>
<sys:String x:Key="LanguageText">语言</sys:String>
<sys:String x:Key="TabItemHeaderReadme">说明文档</sys:String>
<sys:String x:Key="LanguageText">语言(Language)</sys:String>
<sys:String x:Key="LanguageChinese">中文</sys:String>
<sys:String x:Key="LanguageEnglish">英文</sys:String>
<sys:String x:Key="Hosts">主机列表</sys:String>
<sys:String x:Key="AddHost">添加主机</sys:String>
<sys:String x:Key="Actions">操作</sys:String>
<sys:String x:Key="ViewConfig">导出配置</sys:String>
<sys:String x:Key="ViewSub">导出订阅</sys:String>
<sys:String x:Key="Random">随机</sys:String>
<!--table-->
<sys:String x:Key="MainTableSelection">选择</sys:String>
<sys:String x:Key="MainTableRemark">别名</sys:String>
<sys:String x:Key="MainTableHost">主机</sys:String>
<sys:String x:Key="MainTablePort">端口</sys:String>
<sys:String x:Key="MainTableProxy">代理</sys:String>
<sys:String x:Key="MainTableActions">操作</sys:String>
<sys:String x:Key="MainTableControl">控制台</sys:String>
<sys:String x:Key="MainTableViewConfig">查看配置</sys:String>
<sys:String x:Key="MainTableEditor">编辑</sys:String>
<sys:String x:Key="MainTableDelete">删除</sys:String>
<sys:String x:Key="Connect">连接</sys:String>
<sys:String x:Key="Install">安装</sys:String>
<sys:String x:Key="Edit">编辑</sys:String>
<sys:String x:Key="EditTemp">编辑模板</sys:String>
<sys:String x:Key="Delete">删除</sys:String>
<sys:String x:Key="Save">保存</sys:String>
<sys:String x:Key="SaveAs">另存为</sys:String>
<sys:String x:Key="Info">消息</sys:String>
<sys:String x:Key="Warning">提示</sys:String>
<sys:String x:Key="Error">错误</sys:String>
@ -44,6 +63,58 @@
<sys:String x:Key="HostPortNotNull">请输入端口号</sys:String>
<sys:String x:Key="PorxyAddressNotNull">请输入代理地址</sys:String>
<sys:String x:Key="ProxyProtNotNull">请输入代理端口号</sys:String>
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS Over TCP With XTLS&#x0a;性能数倍,首选方式。</sys:String>
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS&#x0a;仍推荐XTLS。</sys:String>
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS&#x0a;推荐支持CDN。</sys:String>
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP&#x0a;游戏推荐,延迟低。</sys:String>
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS&#x0a;推荐支持CDN。</sys:String>
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP&#x0a;游戏推荐,延迟低。</sys:String>
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks&#x0a;SS支持udp。</sys:String>
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS&#x0a;Trojan。</sys:String>
<sys:String x:Key="XrayDomain">域名</sys:String>
<sys:String x:Key="XrayMarkDomain">伪装域名</sys:String>
<sys:String x:Key="XrayUUID">UUID</sys:String>
<sys:String x:Key="VlessWsPath">VLESS WS路径</sys:String>
<sys:String x:Key="VlessKcpSeed">VLESS KCP Seed</sys:String>
<sys:String x:Key="VlessKcpType">VLESS KCP伪装</sys:String>
<sys:String x:Key="VlessKcpPort">VLESS KCP端口</sys:String>
<sys:String x:Key="VmessWsPath">VMESS WS路径</sys:String>
<sys:String x:Key="VmessKcpSeed">VMESS KCP Seed</sys:String>
<sys:String x:Key="VmessKcpType">VMESS KCP伪装</sys:String>
<sys:String x:Key="VmessKcpPort">VMESS KCP端口</sys:String>
<sys:String x:Key="SSPassword">SS密码</sys:String>
<sys:String x:Key="SSMethods">SS加密方式</sys:String>
<sys:String x:Key="TrojanPassword">Trojan密码</sys:String>
<sys:String x:Key="XrayPort">xray端口</sys:String>
<sys:String x:Key="XrayPortDefault">默认端口443不建议修改</sys:String>
<!--Terminal Window-->
<sys:String x:Key="TerminalTitle">控制台</sys:String>
<sys:String x:Key="InstallActions">内核/配置</sys:String>
<sys:String x:Key="InstallXray">一键安装</sys:String>
<sys:String x:Key="UpdateSettings">更新配置</sys:String>
<sys:String x:Key="UpdateXrayCore">更新xray内核</sys:String>
<sys:String x:Key="UninstallXray">卸载代理</sys:String>
<sys:String x:Key="SettingActions">证书/网站</sys:String>
<sys:String x:Key="UpdateCert">续签证书</sys:String>
<sys:String x:Key="UploadSelfCert">上传自有证书</sys:String>
<sys:String x:Key="UploadWeb">上传网站</sys:String>
<sys:String x:Key="UninstallCaddy">卸载Caddy</sys:String>
<sys:String x:Key="ReadmeInstallXray">一键安装: 最后输出 “请尽情享用” 表示完成,到[查看配置]或[导出配置]查看节点</sys:String>
<sys:String x:Key="ReadmeUpdateSettings">更新配置: 修改节点配置信息后,不需要重新安装,这个功能就可以更新配置了</sys:String>
<sys:String x:Key="ReadmeUpdateCert">续签证书: 证书默认是自动续签,但不保证都能续签成功,如果失败请用[续签证书]手动续签</sys:String>
<sys:String x:Key="ReadmeUploadWeb">上传网站: 伪装网站正确的静态网页要有index.html文件(请检查),然后将网站压缩包上传。</sys:String>
<sys:String x:Key="ReadmeWebsiteDemo">如下是网友提供的静态网页连接请自行检查是否有index.html文件</sys:String>
<!--client info window-->
<sys:String x:Key="ClientInfoTitle">查看配置信息</sys:String>
<!--Terminal Window-->
</ResourceDictionary>

View file

@ -1,5 +1,9 @@
##domain##:80 {
:##port## {
root * /usr/share/caddy
file_server
##reverse_proxy##
}
##domain##:80 {
redir https://##domain##{uri}
}

View file

@ -10,7 +10,7 @@
],
"fallbacks": [
{
"dest": 80
"dest": 8080
}
]
},

View file

@ -6,7 +6,8 @@
{
"id": ""
}
]
],
"decryption": "none"
},
"streamSettings": {
"network": "mkcp",

View file

@ -0,0 +1,25 @@
{
"port": 2002,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [
{
"id": ""
}
],
"decryption": "none"
},
"streamSettings": {
"network": "grpc",
"grpcSettings": {
"serviceName": "",
"certificates": [
{
"certificateFile": "/usr/local/etc/xray/ssl/xray_ssl.crt",
"keyFile": "/usr/local/etc/xray/ssl/xray_ssl.key"
}
]
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProxySU_Core.ViewModels
{
public class BaseViewModel2 : INotifyPropertyChanged
{
protected bool SetProperty<T>(ref T backingStore, T value,
string propertyName = "",
Action onChanged = null)
{
if (EqualityComparer<T>.Default.Equals(backingStore, value))
return false;
backingStore = value;
onChanged?.Invoke();
OnPropertyChanged(propertyName);
return true;
}
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName = "")
{
var changed = PropertyChanged;
if (changed == null)
return;
changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}

View file

@ -10,19 +10,72 @@ using System.Threading.Tasks;
using System.Web;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace ProxySU_Core.ViewModels
{
public partial class XraySettingsViewModel : BaseViewModel
{
public XraySettings settings;
private readonly ICommand _randomUuid;
public XraySettingsViewModel(XraySettings parameters)
{
_randomUuid = new BaseCommand((obj) => GetUuid());
this.settings = parameters;
Notify("VMESS_KCP_Type");
}
public ICommand RandomUuid
{
get
{
return _randomUuid;
}
}
public int Port
{
get => settings.Port;
set
{
settings.Port = value;
Notify("Port");
}
}
public int VLESS_KCP_Port
{
get => settings.VLESS_KCP_Port;
set
{
settings.VLESS_KCP_Port = value;
Notify("VLESS_KCP_Port");
}
}
public int VMESS_KCP_Port
{
get => settings.VMESS_KCP_Port;
set
{
settings.VMESS_KCP_Port = value;
Notify("VMESS_KCP_Port");
}
}
public int ShadowSocksPort
{
get => settings.ShadowSocksPort;
set
{
settings.VMESS_KCP_Port = value;
Notify("ShadowSocksPort");
}
}
public string UUID
{
get => settings.UUID;
@ -36,13 +89,21 @@ namespace ProxySU_Core.ViewModels
public string Domain
{
get => settings.Domain;
set => settings.Domain = value;
set
{
settings.Domain = value;
Notify("Domain");
}
}
public string MaskDomain
{
get => settings.MaskDomain;
set => settings.MaskDomain = value;
set
{
settings.MaskDomain = value;
Notify("MaskDomain");
}
}
public string TrojanPassword
@ -125,8 +186,19 @@ namespace ProxySU_Core.ViewModels
}
}
private void GetUuid()
{
UUID = Guid.NewGuid().ToString();
Notify("UUID");
}
}
/// <summary>
/// VMESS
/// </summary>
public partial class XraySettingsViewModel
{
// vmess tcp
@ -168,7 +240,7 @@ namespace ProxySU_Core.ViewModels
{
get => ShareLink.Build(XrayType.VMESS_WS, settings);
}
// vmess kcp
public string VMESS_KCP_Seed
{
@ -206,7 +278,9 @@ namespace ProxySU_Core.ViewModels
public List<string> KcpTypes => _kcpTypes;
}
/// <summary>
/// VLESS
/// </summary>
public partial class XraySettingsViewModel
{
@ -217,7 +291,7 @@ namespace ProxySU_Core.ViewModels
set
{
CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS);
Notify("Checked_VLESS_XTLS");
Notify("Checked_VLESS_TCP_XTLS");
}
}
public string VLESS_TCP_XTLS_ShareLink
@ -225,7 +299,6 @@ namespace ProxySU_Core.ViewModels
get => ShareLink.Build(XrayType.VLESS_TCP_XTLS, settings);
}
// vless tcp
public bool Checked_VLESS_TCP
{
@ -265,6 +338,62 @@ namespace ProxySU_Core.ViewModels
get => ShareLink.Build(XrayType.VLESS_WS, settings);
}
// vless kcp
public string VLESS_KCP_Seed
{
get => settings.VLESS_KCP_Seed;
set => settings.VLESS_KCP_Seed = value;
}
public string VLESS_KCP_Type
{
get => settings.VLESS_KCP_Type;
set
{
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
var trimValue = value.Replace(namespaceStr, "");
trimValue = trimValue.Trim();
settings.VLESS_KCP_Type = trimValue;
Notify("VLESS_KCP_Type");
}
}
public bool Checked_VLESS_KCP
{
get => settings.Types.Contains(XrayType.VLESS_KCP);
set
{
CheckBoxChanged(value, XrayType.VLESS_KCP);
Notify("Checked_VLESS_KCP");
}
}
public string VLESS_KCP_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_KCP, settings);
}
// vless grpc
public string VLESS_gRPC_ServiceName
{
get => settings.VLESS_gRPC_ServiceName;
set => settings.VLESS_gRPC_ServiceName = value;
}
public int VLESS_gRPC_Port
{
get => settings.VLESS_gRPC_Port;
set => settings.VLESS_gRPC_Port = value;
}
public bool Checked_VLESS_gRPC
{
get => settings.Types.Contains(XrayType.VLESS_gRPC);
set
{
CheckBoxChanged(value, XrayType.VLESS_gRPC);
Notify("Checked_VLESS_gRPC");
}
}
public string VLESS_gRPC_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_gRPC, settings);
}
}
}

View file

@ -0,0 +1,114 @@
<metro:MetroWindow x:Class="ProxySU_Core.Views.ClientInfo.ClientInfoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
xmlns:dev="clr-namespace:ProxySU_Core.Models.Developers"
xmlns:models="clr-namespace:ProxySU_Core.Models"
mc:Ignorable="d"
Title="{DynamicResource ClientInfoTitle}" Height="500" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="220" />
</Grid.ColumnDefinitions>
<TabControl Grid.Column="0"
Padding="10"
BorderThickness="1,0,1,0"
BorderBrush="#DDD"
TabStripPlacement="Left"
SelectionChanged="BuildQrCode">
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VLESS_TCP_XTLS}"
IsEnabled="{Binding Settings.Checked_VLESS_TCP_XTLS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-XTLS">
<local:VLESS_XTLS_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VLESS_TCP}"
IsEnabled="{Binding Settings.Checked_VLESS_TCP}"
metro:HeaderedControlHelper.HeaderMargin="0"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-TLS">
<local:VLESS_TCP_TLS_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VLESS_WS}"
IsEnabled="{Binding Settings.Checked_VLESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-WebSocket-TLS">
<local:VLESS_WS_TLS_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VLESS_KCP}"
IsEnabled="{Binding Settings.Checked_VLESS_KCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-mKCP">
<local:VLESS_KCP_Control />
</TabItem>
<!--<TabItem Width="200"
Tag="{x:Static models:XrayType.VLESS_gRPC}"
IsEnabled="{Binding Settings.Checked_VLESS_gRPC}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-gRPC">
<local:VLESS_gRPC_Control />
</TabItem>-->
<!--<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VMESS_TCP}"
IsEnabled="{Binding Settings.Checked_VMESS_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-TCP-TLS">
<local:VMESS_TCP_TLS_Control />
</TabItem>-->
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VMESS_WS}"
IsEnabled="{Binding Settings.Checked_VMESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-WebSocket-TLS">
<local:VMESS_WS_TLS_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VMESS_KCP}"
IsEnabled="{Binding Settings.Checked_VMESS_KCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-mKCP">
<local:VMESS_KCP_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.Trojan_TCP}"
IsEnabled="{Binding Settings.Checked_Trojan_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="Trojan-TCP">
<local:Trojan_TCP_Control />
</TabItem>
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.ShadowsocksAEAD}"
IsEnabled="{Binding Settings.CheckedShadowSocks}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="ShadowSocks">
<local:ShadowSocksControl />
</TabItem>
</TabControl>
<StackPanel Grid.Column="1" >
<Image Width="200" Height="200" x:Name="QrImage" />
<Button Click="SaveImage" Width="100" Content="{DynamicResource SaveAs}" />
</StackPanel>
</Grid>
</metro:MetroWindow>

View file

@ -0,0 +1,128 @@
using Microsoft.Win32;
using ProxySU_Core.Models;
using ProxySU_Core.ViewModels;
using QRCoder;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// ClientInfoWindow.xaml 的交互逻辑
/// </summary>
public partial class ClientInfoWindow
{
public XraySettingsViewModel Settings { get; set; }
public ClientInfoWindow(Record record)
{
InitializeComponent();
ResizeMode = ResizeMode.NoResize;
WindowStartupLocation = WindowStartupLocation.CenterScreen;
Settings = new XraySettingsViewModel(record.Settings);
DataContext = this;
}
private void BuildQrCode(object sender, SelectionChangedEventArgs e)
{
var tabControl = e.Source as TabControl;
var item = (tabControl.SelectedItem as TabItem);
if (item == null) return;
var type = (XrayType)item.Tag;
BuildQrCode(type);
}
private void SaveImage(object sender, RoutedEventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName += QrImage.Tag;
sfd.Filter = "Image Files (*.bmp, *.png, *.jpg)|*.bmp;*.png;*.jpg | All Files | *.*";
sfd.RestoreDirectory = true;//保存对话框是否记忆上次打开的目录
if (sfd.ShowDialog() == true)
{
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create((BitmapSource)QrImage.Source));
using (FileStream stream = new FileStream(sfd.FileName, FileMode.Create))
encoder.Save(stream);
}
}
private void BuildQrCode(XrayType type)
{
string shareLink = string.Empty;
switch (type)
{
case XrayType.VLESS_TCP_XTLS:
shareLink = Settings.VLESS_TCP_XTLS_ShareLink;
break;
case XrayType.VLESS_TCP:
shareLink = Settings.VLESS_TCP_ShareLink;
break;
case XrayType.VLESS_WS:
shareLink = Settings.VLESS_WS_ShareLink;
break;
case XrayType.VLESS_H2:
break;
case XrayType.VLESS_KCP:
shareLink = Settings.VLESS_KCP_ShareLink;
break;
case XrayType.VLESS_gRPC:
shareLink = Settings.VLESS_gRPC_ShareLink;
break;
case XrayType.VMESS_TCP:
shareLink = Settings.VMESS_TCP_ShareLink;
break;
case XrayType.VMESS_WS:
shareLink = Settings.VMESS_WS_ShareLink;
break;
case XrayType.VMESS_H2:
break;
case XrayType.VMESS_KCP:
shareLink = Settings.VMESS_KCP_ShareLink;
break;
case XrayType.Trojan_TCP:
shareLink = Settings.Trojan_TCP_ShareLink;
break;
case XrayType.Trojan_WS:
break;
case XrayType.ShadowsocksAEAD:
shareLink = Settings.ShadowSocksShareLink;
break;
default:
break;
}
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(shareLink, QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(20);
MemoryStream ms = new MemoryStream();
qrCodeImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] bytes = ms.GetBuffer();
ms.Close();
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = new MemoryStream(bytes);
image.EndInit();
QrImage.Source = image;
QrImage.Tag = type.ToString();
}
}
}

View file

@ -0,0 +1,34 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.ShadowSocksControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(Address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(Port)" Width="120" />
<TextBox Text="{Binding Path=Settings.ShadowSocksPort,Mode=OneTime}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="密码(Password)" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksPassword}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密方式(Method)" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksMethod}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// ShadowSocksClientInfoControl.xaml 的交互逻辑
/// </summary>
public partial class ShadowSocksControl : UserControl
{
public ShadowSocksControl()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,29 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.Trojan_TCP_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="服务器地址(Address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="服务器端口(Port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="密码(Pwd)" Width="120" />
<TextBox Text="{Binding Settings.TrojanPassword}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.Trojan_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// Trojan_TCP_Control.xaml 的交互逻辑
/// </summary>
public partial class Trojan_TCP_Control : UserControl
{
public Trojan_TCP_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,59 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_KCP_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Port,Mode=OneTime}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="kcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_KCP_Type}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_KCP_Seed}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_KCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_KCP_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_KCP_Control : UserControl
{
public VLESS_KCP_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,64 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_TCP_TLS_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_TCP_TLS_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_TCP_TLS_Control : UserControl
{
public VLESS_TCP_TLS_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,64 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_WS_TLS_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="ws" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_WS_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_WS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_WS_TLS_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_WS_TLS_Control : UserControl
{
public VLESS_WS_TLS_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,64 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_XTLS_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="xtls-rprx-direct" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="xtls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_XTLS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_XTLS_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_XTLS_Control : UserControl
{
public VLESS_XTLS_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,64 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_gRPC_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_Port}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="grpc" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_ServiceName}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_gRPC_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_gRPC_Control : UserControl
{
public VLESS_gRPC_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,59 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VMESS_KCP_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Port,Mode=OneTime}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="kcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Type}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Seed}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VMESS_KCP_Control.xaml 的交互逻辑
/// </summary>
public partial class VMESS_KCP_Control : UserControl
{
public VMESS_KCP_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,59 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VMESS_TCP_TLS_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="http" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_TCP_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VMESS_TCP_TLS_Control.xaml 的交互逻辑
/// </summary>
public partial class VMESS_TCP_TLS_Control : UserControl
{
public VMESS_TCP_TLS_Control()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,59 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VMESS_WS_TLS_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="ws" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_WS_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接(ShareLink)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_WS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VMESS_WS_TLS_Control.xaml 的交互逻辑
/// </summary>
public partial class VMESS_WS_TLS_Control : UserControl
{
public VMESS_WS_TLS_Control()
{
InitializeComponent();
}
}
}

View file

@ -1,428 +0,0 @@
<metro:MetroWindow x:Class="ProxySU_Core.Views.ClientInfoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:ProxySU_Core.Views"
xmlns:dev="clr-namespace:ProxySU_Core.Models.Developers"
mc:Ignorable="d"
Title="查看配置" Height="500" Width="800">
<Grid>
<TabControl
Background="#fff"
Style="{StaticResource MaterialDesignNavigatilRailTabControl}"
Padding="10">
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_XTLS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-XTLS">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="xtls-rprx-splice" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="xtls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_XTLS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-TLS">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-WebSocket-TLS">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="ws" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_WS_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VLESS_WS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VMESS_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-TCP-TLS">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="tcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="http" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_TCP_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VMESS_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VMESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-WebSocket-TLS">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="ws" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_WS_Path}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VMESS_WS_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VMESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VMESS-mKCP">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="{Binding Source={x:Static dev:ConfigBuilder.VMESS_mKCP_Port},Mode=OneTime}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(security)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="kcp" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Type}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Seed}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_Trojan_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-Trojan">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="服务器地址" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="服务器端口" Width="120" />
<TextBox Text="443" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="密码" Width="120" />
<TextBox Text="{Binding Settings.TrojanPassword}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.Trojan_TCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.CheckedShadowSocks}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="ShadowSocks">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="服务器地址" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="服务器端口" Width="120" />
<TextBox Text="{Binding Source={x:Static dev:ConfigBuilder.ShadowSocksPort},Mode=OneTime}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="密码" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksPassword}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密方式" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksMethod}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.ShadowSocksShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</metro:MetroWindow>

View file

@ -1,36 +0,0 @@
using ProxySU_Core.Models;
using ProxySU_Core.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ProxySU_Core.Views
{
/// <summary>
/// ClientInfoWindow.xaml 的交互逻辑
/// </summary>
public partial class ClientInfoWindow
{
public XraySettingsViewModel Settings { get; set; }
public ClientInfoWindow(Record record)
{
InitializeComponent();
ResizeMode = ResizeMode.NoResize;
WindowStartupLocation = WindowStartupLocation.CenterScreen;
Settings = new XraySettingsViewModel(record.Settings);
DataContext = this;
}
}
}

View file

@ -9,7 +9,7 @@
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
TextElement.FontSize="14"
Title="ProxySU Core" Height="800" Width="1200">
Title="ProxySU Core" Height="670" Width="1050">
<mah:MetroWindow.LeftWindowCommands>
<mah:WindowCommands>
@ -25,8 +25,7 @@
<TextBlock Text="{DynamicResource LanguageText}" VerticalAlignment="Center" Margin="0,0,20,0" />
<ComboBox
SelectionChanged="ChangeLanguage"
x:Name="cmbLanguage"
IsEnabled="False"
x:Name="cmbLanguage"
SelectedIndex="0">
<ComboBoxItem x:Name="zh_cn" Content="{DynamicResource LanguageChinese}"></ComboBoxItem>
<ComboBoxItem x:Name="en" Content="{DynamicResource LanguageEnglish}"></ComboBoxItem>
@ -44,36 +43,38 @@
<Grid>
<TabControl
BorderThickness="0,1,0,0"
BorderBrush="#DDD"
Background="#fff"
Style="{StaticResource MaterialDesignNavigatilRailTabControl}"
Padding="10">
Padding="20">
<TabItem
Width="160"
Height="40"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="{DynamicResource TabItemHeaderAppDeployment}">
<StackPanel Orientation="Vertical">
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="5,0,0,0">
<Button
Content="{DynamicResource AddHost}"
Click="AddHost"
Width="100"/>
Width="140"/>
<Button
Margin="10,0,0,0"
Content="导出配置"
Content="{DynamicResource ViewConfig}"
Click="ExportXraySettings"
Width="100" />
Width="140" />
<Button
Margin="10,0,0,0"
Content="导出订阅"
Content="{DynamicResource ViewSub}"
Click="ExportXraySub"
Width="100" />
Width="140" />
</StackPanel>
<DataGrid ItemsSource="{Binding Records}"
Margin="0,20,0,0"
Margin="0,10,0,0"
IsReadOnly="True"
x:Name="DataGrid"
CellStyle="{StaticResource DataGridCell}"
@ -82,35 +83,51 @@
SelectionUnit="FullRow"
BorderBrush="#eee"
BorderThickness="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"
Height="500"
Width="1000"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridCheckBoxColumn Header="选择"
Binding="{Binding Path=IsChecked, UpdateSourceTrigger=PropertyChanged}"
<DataGridCheckBoxColumn Binding="{Binding Path=IsChecked, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="False"
Width="80"/>
<DataGridTextColumn Header="{DynamicResource HostTag}"
Binding="{Binding Path=Host.Tag}"
Width="150"/>
<DataGridTextColumn Header="{DynamicResource HostAddress}"
Binding="{Binding Path=Host.Address}"
Width="200"/>
<DataGridTextColumn Header="{DynamicResource HostPort}"
Binding="{Binding Path=Host.Port}"
Width="100"/>
<DataGridTextColumn Header="{DynamicResource ProxyGroupName}"
Binding="{Binding Path=Host.Proxy.Type}"
Width="100"/>
Width="80">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{DynamicResource MainTableSelection}" />
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<DataGridTextColumn Binding="{Binding Path=Host.Tag}" Width="180">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainTableRemark}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=Host.Address}" Width="180">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainTableHost}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=Host.Port}" Width="100">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainTablePort}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=Host.Proxy.Type}" Width="100">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainTableProxy}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource Actions}" />
<TextBlock Text="{DynamicResource MainTableActions}" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Content="控制台" FontSize="12" Height="24" Click="Connect" />
<Button Content="查看配置" FontSize="12" Height="24" Margin="10,0,0,0" Click="ShowClientInfo" />
<Button Content="编辑" FontSize="12" Height="24" Margin="10,0,0,0" Click="EditHost" />
<Button Content="删除" FontSize="12" Height="24" Margin="10,0,0,0" Click="DeleteHost" BorderBrush="IndianRed" Background="IndianRed" />
<Button Content="{DynamicResource MainTableControl}" FontSize="12" Height="24" Click="Connect" />
<Button Content="{DynamicResource MainTableViewConfig}" FontSize="12" Height="24" Margin="10,0,0,0" Click="ShowClientInfo" />
<Button Content="{DynamicResource MainTableEditor}" FontSize="12" Height="24" Margin="10,0,0,0" Click="EditHost" />
<Button Content="{DynamicResource MainTableDelete}" FontSize="12" Height="24" Margin="10,0,0,0" Click="DeleteHost" BorderBrush="IndianRed" Background="IndianRed" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@ -123,11 +140,31 @@
</TabItem>
<TabItem
Width="160"
Width="160"
Height="40"
FontSize="15"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="其他功能">
Header="{DynamicResource TabItemHeaderReadme}">
<StackPanel>
<TextBlock Text="还不知道要点啥...看大家建议?" />
<StackPanel Margin="0,0,0,0">
<TextBlock Margin="0,0,0,5" Text="新书指引:" FontWeight="Black" />
<TextBlock Text="1. 【添加主机】,填写主机信息及节点配置信息,保存。" />
<TextBlock Text="2. 点【控制台】,自动连接主机,连接成功后,点【一键安装】,待输出 “请尽情享用吧” 代表安装完成。" />
<TextBlock Text="3. 在【查看配置】中可以查看节点配置信息,选中【导出配置】可以复制所有节点的分享拦截。" />
</StackPanel>
<StackPanel Margin="0,20,0,0">
<TextBlock Margin="0,0,0,5" Text="自定义功能" FontWeight="Black" />
<TextBlock Text="【更新配置】用户想修改节点的信息比如增加一个websocket或修改用户id在【编辑】中修改保存后不需要重新安装了这个功能就可以更新配置。" />
<TextBlock Text="【更新内核】更新官方xray-core的最新版本。" />
<TextBlock Text="【卸载代理】:卸载 域名证书、caddy服务、xray内核一些安装过程中的基础功能不影响不卸载会影响到您的系统请自行处理。" />
<TextBlock Text="【续签证书】:默认是会自动续签的,但由于各种平台的基础环境不一样,可能有些会续签失败,这个功能可手动续签证书。" />
<TextBlock Text="【上传证书】:上传自有证书,将您的证书 crt 和 key 文件打包zip上传即可。" />
<TextBlock Text="【上传网站】上传伪装静态网站静态网站必须根目录有一个index.html文件请自行检查。" />
</StackPanel>
<StackPanel Margin="0,20,0,0">
<TextBlock Margin="0,0,0,5" Text="关于v3版本" FontWeight="Black" />
<TextBlock Text="初步以xray为基础方便自动安装、修改、卸载看建议再考虑其他方式如有需要请先用v2的版本。" />
</StackPanel>
</StackPanel>
</TabItem>
</TabControl>

View file

@ -5,6 +5,8 @@ using ProxySU_Core.Common;
using ProxySU_Core.Models;
using ProxySU_Core.ViewModels;
using ProxySU_Core.Views;
using ProxySU_Core.Views.ClientInfo;
using ProxySU_Core.Views.RecordEditor;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -23,6 +25,10 @@ namespace ProxySU_Core
public partial class MainWindow
{
private const string RecordPath = @"Data\Record.json";
private const string SettingsPath = @"Data\AppSettings.json";
private const string ZH_CN = "zh_cn";
private const string EN = "en";
public ObservableCollection<RecordViewModel> Records { get; set; }
@ -32,7 +38,19 @@ namespace ProxySU_Core
InitializeComponent();
Records = new ObservableCollection<RecordViewModel>();
LoadRecords();
DataContext = this;
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
this.SaveRecord();
}
private void LoadRecords()
{
if (File.Exists(RecordPath))
{
var recordsJson = File.ReadAllText(RecordPath, Encoding.UTF8);
@ -45,9 +63,6 @@ namespace ProxySU_Core
});
}
}
DataContext = this;
}
private void SaveRecord()
@ -63,7 +78,7 @@ namespace ProxySU_Core
{
Directory.CreateDirectory("Data");
}
File.WriteAllText("Data\\Record.json", json, Encoding.UTF8);
File.WriteAllText(RecordPath, json, Encoding.UTF8);
}
private void LaunchGitHubSite(object sender, RoutedEventArgs e)
@ -76,30 +91,33 @@ namespace ProxySU_Core
System.Diagnostics.Process.Start("explorer.exe", "https://github.com/proxysu/ProxySU");
}
private void ChangeLanguage(object sender, SelectionChangedEventArgs e)
{
var selection = cmbLanguage.SelectedValue as ComboBoxItem;
if (selection.Name == "zh_cn")
if (selection.Name == ZH_CN)
{
ChangeLanguage("zh_cn");
ChangeLanguage(ZH_CN);
}
else if (selection.Name == "en")
else if (selection.Name == EN)
{
ChangeLanguage("en");
ChangeLanguage(EN);
}
}
private void ChangeLanguage(string culture)
{
ResourceDictionary resource = new ResourceDictionary();
if (string.Equals(culture, "zh_cn", StringComparison.OrdinalIgnoreCase))
if (string.Equals(culture, ZH_CN, StringComparison.OrdinalIgnoreCase))
{
resource.Source = new Uri(@"Resources\Languages\zh_cn.xaml", UriKind.Relative);
}
else if (string.Equals(culture, "en", StringComparison.OrdinalIgnoreCase))
else if (string.Equals(culture, EN, StringComparison.OrdinalIgnoreCase))
{
resource.Source = new Uri(@"Resources\Languages\en.xaml", UriKind.Relative);
}
@ -164,6 +182,19 @@ namespace ProxySU_Core
}
}
private void DeleteHost(object sender, RoutedEventArgs e)
{
if (DataGrid.SelectedItem is RecordViewModel project)
{
var result = MessageBox.Show($"您确认删除主机{project.Host.Tag}吗?", "提示", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
Records.Remove(project);
SaveRecord();
}
}
}
private void ShowClientInfo(object sender, RoutedEventArgs e)
{
if (DataGrid.SelectedItem is RecordViewModel project)
@ -174,19 +205,6 @@ namespace ProxySU_Core
}
private void DeleteHost(object sender, RoutedEventArgs e)
{
if (DataGrid.SelectedItem is RecordViewModel project)
{
var result = MessageBox.Show($"您确认删除主机{project.Host.Tag}吗?", "提示", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
Records.Remove(project);
}
}
}
private void Connect(object sender, RoutedEventArgs e)
{
var project = DataGrid.SelectedItem as RecordViewModel;

View file

@ -0,0 +1,75 @@
<metro:MetroWindow x:Class="ProxySU_Core.Views.RecordEditor.RecordEditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:models="clr-namespace:ProxySU_Core.Models"
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
mc:Ignorable="d"
Title="{DynamicResource HostWindowTitle}" Height="600" Width="1100">
<Window.Resources>
<converters:VisibleConverter x:Key="VisibleConverter" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="0" />
</Grid.RowDefinitions>
<local:ServerInfoControl Grid.Column="0" Grid.Row="0" Margin="10" />
<GridSplitter IsEnabled="False" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" />
<StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TabControl Grid.Row="0" BorderThickness="0,1,0,0" BorderBrush="#DDD" Padding="10">
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Header="xray-vless">
<ScrollViewer Name="scroll"
BorderBrush="#ddd"
BorderThickness="2"
Width="auto"
Height="450"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" >
<local:XrayEditorControl />
</ScrollViewer>
</TabItem>
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Padding="10,5,10,5" Header="Trojan-Go">
Trojan-Go 未完成(Not Implemented)
</TabItem>
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Padding="10,5,10,5" Header="NaiveProxy">
Naive Proxy 未完成(Not Implemented)
</TabItem>
</TabControl>
<StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">
<Border BorderBrush="#DDD" BorderThickness="0,1,0,0" />
<Button Content="{DynamicResource Save}"
Margin="15"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Width="120"
Height="32"
Click="Save" />
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</metro:MetroWindow>

View file

@ -14,7 +14,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ProxySU_Core.Views
namespace ProxySU_Core.Views.RecordEditor
{
/// <summary>
/// RecordEditorWindow.xaml 的交互逻辑
@ -49,10 +49,5 @@ namespace ProxySU_Core.Views
Close();
}
public void RandomUuid(object sender, RoutedEventArgs e)
{
Settings.UUID = Guid.NewGuid().ToString();
}
}
}

View file

@ -0,0 +1,198 @@
<UserControl x:Class="ProxySU_Core.Views.RecordEditor.ServerInfoControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
xmlns:models="clr-namespace:ProxySU_Core.Models"
mc:Ignorable="d">
<UserControl.Resources>
<converters:ProxyTypeConverter x:Key="ProxyTypeConverter" />
<converters:LoginSecretTypeConverter x:Key="LoginSecretTypeConverter" />
</UserControl.Resources>
<StackPanel>
<GroupBox
Style="{StaticResource MaterialDesignHeaderedContentControl}"
Header="{StaticResource ConnectionGroupName}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostTag}"
VerticalAlignment="Center"/>
<TextBox
Text="{Binding Path=Host.Tag}"
Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostAddress}"
VerticalAlignment="Center"/>
<TextBox
Text="{Binding Path=Host.Address}"
Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostPort}"
VerticalAlignment="Center" />
<TextBox
Text="{Binding Path=Host.Port}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostUserName}"
VerticalAlignment="Center" />
<TextBox
Text="{Binding Path=Host.UserName}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostLoginType}"
VerticalAlignment="Center" />
<RadioButton
GroupName="LoginType"
IsChecked="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.Password}
}"
Content="{DynamicResource PasswordLogin}" />
<RadioButton
Margin="10,0,0,0"
GroupName="LoginType"
IsChecked="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.PrivateKey}
}"
Content="{DynamicResource KeyLogin}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="{Binding Host.PasswordVisiblity}">
<TextBlock
Width="100"
Text="{DynamicResource HostPassword}"
VerticalAlignment="Center" />
<TextBox
IsEnabled="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.Password}
}"
Text="{Binding Path=Host.Password}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="{Binding Path=Host.KeyUploaderVisiblity}">
<TextBlock
Width="100"
Text="{DynamicResource KeyLoginField}"
VerticalAlignment="Center" />
<Button
IsEnabled="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.PrivateKey}
}"
Command="{Binding Path=Host.SelectKeyCommand}"
Content="{DynamicResource KeyUpload}" />
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox
Margin="0,10,0,0"
Header="{DynamicResource ProxyGroupName}"
Style="{StaticResource MaterialDesignHeaderedContentControl}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyType}" />
<RadioButton
GroupName="ProxyType"
Content="{StaticResource ProxyTypeNone}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.None}
}"/>
<RadioButton
Margin="10,0,0,0"
GroupName="ProxyType"
Content="{DynamicResource ProxyTypeHttp}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.Http}
}"/>
<RadioButton
Margin="10,0,0,0"
GroupName="ProxyType"
Content="{DynamicResource ProxyTypeSocks5}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.Socks5}
}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyHostName}"
VerticalAlignment="Center" />
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Address}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyHostPort}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Port}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyUserName}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.UserName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyPassword}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Password}"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.RecordEditor
{
/// <summary>
/// ServerInfoControl.xaml 的交互逻辑
/// </summary>
public partial class ServerInfoControl : UserControl
{
public ServerInfoControl()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,295 @@
<UserControl x:Class="ProxySU_Core.Views.RecordEditor.XrayEditorControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<converters:VisibleConverter x:Key="VisibleConverter" />
</UserControl.Resources>
<StackPanel Orientation="Horizontal">
<StackPanel Width="220">
<!--XTLS-->
<CheckBox Margin="0,10,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_TCP_XTLS}">
<Label Content="{DynamicResource VlessXtlsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<CheckBox Margin="0,15,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_TCP}">
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_WS}">
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
Foreground="LimeGreen"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_KCP}">
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<!--<CheckBox Content="VMESS over TCP with TLS&#x0a;不推荐"
Margin="0,15,0,0"
FontSize="13"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_TCP}" />-->
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_WS}">
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_KCP}">
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
</CheckBox>
<!--ss-->
<CheckBox Margin="0,15,0,0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.CheckedShadowSocks}">
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
</CheckBox>
<!--Trojan-->
<CheckBox Margin="0,15,0,0"
Foreground="CadetBlue"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_Trojan_TCP}">
<Label Content="{DynamicResource TrojanDesc}" FontSize="13" Foreground="CadetBlue" />
</CheckBox>
<!--gRPC-->
<!--<CheckBox Content="VLESS gRPC&#x0a;基于http2多路复用。"
Margin="0,15,0,0"
Grid.Column="0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_gRPC}"/>-->
</StackPanel>
<!--************************** 参数 **************************-->
<StackPanel Width="auto">
<!--Domain-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayDomain}" Width="120" />
<TextBox Text="{Binding Path=Settings.Domain}" Width="260" />
</StackPanel>
<!--Mask Domain-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
<TextBox Text="{Binding Path=Settings.MaskDomain}" Width="260" />
</StackPanel>
<!--UUID-->
<StackPanel Margin="40,10,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayUUID}" Width="120" />
<TextBox Text="{Binding Path=Settings.UUID}"
Width="260" />
<Button Style="{StaticResource MahApps.Styles.Button.Flat}"
Margin="5,0,0,0"
FontSize="12"
Command="{Binding Path=Settings.RandomUuid}"
Content="{DynamicResource Random}" />
</StackPanel>
<!--WebSocket Path-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=Settings.VLESS_WS_Path}"
Width="260" />
</StackPanel>
<!--seed-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Seed}" Width="260" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="40,15,0,0"
Visibility="{
Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}" Orientation="Horizontal">
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
<ComboBox Width="260"
ItemsSource="{Binding Path=Settings.KcpTypes}"
SelectedValue="{Binding Settings.VLESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="40,15,0,0"
Visibility="{
Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}"
Orientation="Horizontal">
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Port}" Width="260" />
</StackPanel>
<!--gRPC Port-->
<!--<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_gRPC,
Converter={StaticResource VisibleConverter}
}">
<Label Content="gRPC端口" Width="120" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=Settings.VLESS_gRPC_Port}" Width="120" />
<Label Content="服务器" Width="120" Margin="10,0,0,0" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=Settings.VLESS_gRPC_ServiceName}" Width="120" />
</StackPanel>-->
<!--Tcp Path-->
<!--<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="VMESS WS路径" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=Settings.VMESS_TCP_Path}"
VerticalAlignment="Bottom"
Width="260" />
</StackPanel>-->
<!--WebSocket Path-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=Settings.VMESS_WS_Path}"
VerticalAlignment="Bottom"
Width="260" />
</StackPanel>
<!--seed-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Seed}" Width="260" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
<ComboBox Width="260"
VerticalAlignment="Bottom"
ItemsSource="{Binding Path=Settings.KcpTypes}"
SelectedValue="{Binding Settings.VMESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Port}" Width="260" />
</StackPanel>
<!--ss密码-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
<TextBox Text="{Binding Path=Settings.ShadowSocksPassword}"
Width="260"/>
</StackPanel>
<!--ss加密方式-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
<ComboBox Width="260"
ItemsSource="{Binding Settings.ShadowSocksMethods}"
SelectedValue="{Binding Settings.ShadowSocksMethod}">
</ComboBox>
</StackPanel>
<!--Trojan密码-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_Trojan_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
<TextBox Text="{Binding Path=Settings.TrojanPassword}"
Width="260" />
</StackPanel>
<!--xray prot-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayPort}" Foreground="Gray" Width="120" />
<TextBox Text="{Binding Path=Settings.Port}" Width="120" />
<Label Content="{DynamicResource XrayPortDefault}" Foreground="Red" />
</StackPanel>
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.RecordEditor
{
/// <summary>
/// XrayEditorControl.xaml 的交互逻辑
/// </summary>
public partial class XrayEditorControl : UserControl
{
public XrayEditorControl()
{
InitializeComponent();
}
}
}

View file

@ -1,400 +0,0 @@
<metro:MetroWindow x:Class="ProxySU_Core.Views.RecordEditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:models="clr-namespace:ProxySU_Core.Models"
xmlns:local="clr-namespace:ProxySU_Core.Views"
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
mc:Ignorable="d"
Title="编辑主机信息" Height="600" Width="980">
<Window.Resources>
<converters:LoginSecretTypeConverter x:Key="LoginSecretTypeConverter" />
<converters:ProxyTypeConverter x:Key="ProxyTypeConverter" />
<converters:VisibleConverter x:Key="VisibleConverter" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="0" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Margin="10">
<GroupBox
Style="{StaticResource MaterialDesignHeaderedContentControl}"
Header="{StaticResource ConnectionGroupName}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostTag}"
VerticalAlignment="Center"/>
<TextBox
Text="{Binding Path=Host.Tag}"
Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostAddress}"
VerticalAlignment="Center"/>
<TextBox
Text="{Binding Path=Host.Address}"
Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostPort}"
VerticalAlignment="Center" />
<TextBox
Text="{Binding Path=Host.Port}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostUserName}"
VerticalAlignment="Center" />
<TextBox
Text="{Binding Path=Host.UserName}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource HostLoginType}"
VerticalAlignment="Center" />
<RadioButton
GroupName="LoginType"
IsChecked="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.Password}
}"
Content="{DynamicResource PasswordLogin}" />
<RadioButton
Margin="10,0,0,0"
GroupName="LoginType"
IsChecked="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.PrivateKey}
}"
Content="{DynamicResource KeyLogin}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="{Binding Host.PasswordVisiblity}">
<TextBlock
Width="100"
Text="{DynamicResource HostPassword}"
VerticalAlignment="Center" />
<TextBox
IsEnabled="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.Password}
}"
Text="{Binding Path=Host.Password}"
Width="200"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="{Binding Path=Host.KeyUploaderVisiblity}">
<TextBlock
Width="100"
Text="{DynamicResource KeyLoginField}"
VerticalAlignment="Center" />
<Button
IsEnabled="{
Binding Path=Host.SecretType,
Converter={StaticResource LoginSecretTypeConverter},
ConverterParameter={x:Static models:LoginSecretType.PrivateKey}
}"
Command="{Binding Path=Host.SelectKeyCommand}"
Content="{DynamicResource KeyUpload}" />
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox
Margin="0,10,0,0"
Header="{DynamicResource ProxyGroupName}"
Style="{StaticResource MaterialDesignHeaderedContentControl}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyType}" />
<RadioButton
GroupName="ProxyType"
Content="{StaticResource ProxyTypeNone}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.None}
}"/>
<RadioButton
Margin="10,0,0,0"
GroupName="ProxyType"
Content="{DynamicResource ProxyTypeHttp}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.Http}
}"/>
<RadioButton
Margin="10,0,0,0"
GroupName="ProxyType"
Content="{DynamicResource ProxyTypeSocks5}"
IsChecked="{
Binding Path=Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static models:LocalProxyType.Socks5}
}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyHostName}"
VerticalAlignment="Center" />
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Address}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyHostPort}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Port}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyUserName}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.UserName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock
Width="100"
Text="{DynamicResource ProxyPassword}"
VerticalAlignment="Center"/>
<TextBox
Width="200"
Text="{Binding Path=Host.Proxy.Password}"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
<GridSplitter Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" />
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="0" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<StackPanel>
<CheckBox Content="VLESS OVER TCP with XTLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_TCP_XTLS}"
Margin="0,10,0,0" />
<Label Content="数倍性能首选方式不支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VLESS over TCP with TLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_TCP}"
Margin="0,10,0,0" />
<Label Content="不支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VLESS over WS with TLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VLESS_WS}"
Margin="0,10,0,0" />
<Label Content="推荐支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VMess over TCP with TLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_TCP}"
Margin="0,10,0,0" />
<Label Content="不推荐" Margin="20,0,0,0" Foreground="Red" />
<CheckBox Content="VMess over WS with TLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_WS}"
Margin="0,10,0,0" />
<Label Content="常规支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VMess mKCP"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_VMESS_KCP}"
Margin="0,10,0,0" />
<Label Content="低延迟,适用于游戏" Margin="20,0,0,0" />
<CheckBox Content="Trojan over TCP with TLS"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.Checked_Trojan_TCP}"
Margin="0,10,0,0" />
<Label Content="Torjan协议不支持CDN" Margin="20,0,0,0" />
<CheckBox Content="ShadowSocksAEAD"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Settings.CheckedShadowSocks}"
Margin="0,10,0,0" />
<Label Content="俗称SS" Margin="20,0,0,0" />
</StackPanel>
<StackPanel Margin="60,0,0,0">
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
<Label Content="UUID" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.UUID}" Width="200" />
<Button Style="{StaticResource MahApps.Styles.Button.Flat}"
Margin="5,0,0,0"
Click="RandomUuid"
Content="随机" />
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<Label Content="域名" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.Domain}" Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<Label Content="伪装域名" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.MaskDomain}" Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="VLESS-WS" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.VLESS_WS_Path}"
Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="VMESS-TCP" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.VMESS_TCP_Path}"
Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="VMESS-WS" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.VMESS_WS_Path}"
Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_Trojan_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="Trojan密码" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.TrojanPassword}"
Width="200" />
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP伪装" Width="80" VerticalAlignment="Center"/>
<ComboBox Width="200"
ItemsSource="{Binding Path=Settings.KcpTypes}"
SelectedValue="{Binding Settings.VMESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP Seed" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Seed}"
Width="200"/>
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="SS 密码" Width="80" VerticalAlignment="Center" />
<TextBox Text="{Binding Path=Settings.ShadowSocksPassword}"
Width="200"/>
</StackPanel>
<StackPanel Margin="0,10,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="SS 加密方式" Width="80" VerticalAlignment="Center" />
<ComboBox Width="200"
ItemsSource="{Binding Settings.ShadowSocksMethods}"
SelectedValue="{Binding Settings.ShadowSocksMethod}">
</ComboBox>
</StackPanel>
</StackPanel>
</StackPanel>
<Button Content="保存"
Grid.Row="1"
HorizontalAlignment="Right"
Width="120"
Height="32"
Click="Save" />
</Grid>
</StackPanel>
</Grid>
</metro:MetroWindow>

View file

@ -6,7 +6,8 @@
xmlns:local="clr-namespace:ProxySU_Core"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="主机控制台" Height="500" Width="800">
FontSize="15"
Title="{DynamicResource TerminalTitle}" Height="640" Width="900">
<StackPanel>
<TextBox IsReadOnly="True"
Block.LineHeight="18"
@ -23,88 +24,101 @@
Orientation="Vertical"
HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal">
<TextBlock Text="内核/配置"
<TextBlock Text="{DynamicResource InstallActions}"
VerticalAlignment="Center"
Width="100"
Margin="0,0,10,0"/>
<Button Content="安装Xray"
<Button Content="{DynamicResource InstallXray}"
Click="Install"
Height="26"
IsEnabled="{Binding HasConnected}"
Width="120"/>
Width="150"/>
<Button Content="更新Xray内核"
Margin="10,0,0,0"
Click="UpdateXrayCore"
Height="26"
IsEnabled="{Binding HasConnected}"
Width="120"/>
<Button Content="更新Xray配置"
<Button Content="{DynamicResource UpdateSettings}"
Margin="10,0,0,0"
Click="UpdateXraySettings"
Height="26"
IsEnabled="{Binding HasConnected}"
Width="120"/>
Width="150"/>
<Button Content="卸载代理"
<Button Content="{DynamicResource UpdateXrayCore}"
Margin="10,0,0,0"
Click="UpdateXrayCore"
Height="26"
IsEnabled="{Binding HasConnected}"
Width="150"/>
<Button Content="{DynamicResource UninstallXray}"
Margin="10,0,0,0"
Click="UninstallXray"
Height="26"
Width="120"
Width="150"
IsEnabled="{Binding HasConnected}"/>
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="0,10,0,0">
<TextBlock Text="证书/网站"
<TextBlock Text="{DynamicResource SettingActions}"
VerticalAlignment="Center"
Width="100"
Margin="0,0,10,0"/>
<Button Content="申请证书"
<Button Content="{DynamicResource UpdateCert}"
Margin="0,0,0,0"
Height="26"
Width="120"
Width="150"
IsEnabled="{Binding HasConnected}"
Click="InstallCert"/>
<Button Content="上传自有证书"
<Button Content="{DynamicResource UploadSelfCert}"
Margin="10,0,0,0"
Height="26"
Width="120"
Width="150"
IsEnabled="{Binding HasConnected}"
Click="UploadCert"/>
<Button Content="上传伪装网站"
<Button Content="{DynamicResource UploadWeb}"
Margin="10,0,0,0"
Height="26"
Width="120"
Width="150"
IsEnabled="{Binding HasConnected}"
Click="UploadWeb"/>
<Button Content="重装Caddy"
<Button Content="{DynamicResource UninstallCaddy}"
Margin="10,0,0,0"
Click="ReinstallCaddy"
Click="UninstallCaddy"
Height="26"
IsEnabled="{Binding HasConnected}"
Width="120"/>
Width="150"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="10,0,0,0">
<Label Content="静态网页模版(感谢网友推荐),将网站压缩包上传到服务区即可。" />
<TextBlock>
<Hyperlink NavigateUri="https://www.themezy.com" Click="OpenLink">Themezy</Hyperlink>
</TextBlock>
<TextBlock>
<Hyperlink NavigateUri="https://onepagelove.com/templates/free-templates" Click="OpenLink">One Page Love</Hyperlink>
</TextBlock>
<TextBlock>
<Hyperlink NavigateUri="https://html5up.net/" Click="OpenLink">HTML5 UP</Hyperlink>
</TextBlock>
<TextBlock>
<Hyperlink NavigateUri="https://templatemo.com/" Click="OpenLink">template mo</Hyperlink>
</TextBlock>
<Label Content="说明(Readme)"/>
<StackPanel Margin="10,0,0,0">
<TextBlock TextWrapping="WrapWithOverflow" Text="{DynamicResource ReadmeInstallXray}" />
<TextBlock TextWrapping="WrapWithOverflow" Text="{DynamicResource ReadmeUpdateSettings}" />
<TextBlock TextWrapping="WrapWithOverflow" Text="{DynamicResource ReadmeUpdateCert}" />
<TextBlock TextWrapping="WrapWithOverflow" Text="{DynamicResource ReadmeUploadWeb}" />
</StackPanel>
<Label Margin="0,10,0,0" Content="{DynamicResource ReadmeWebsiteDemo}" />
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10,0,0,0">
<Hyperlink NavigateUri="https://www.themezy.com" Click="OpenLink">Themezy</Hyperlink>
</TextBlock>
<TextBlock Margin="20,0,0,0">
<Hyperlink NavigateUri="https://onepagelove.com/templates/free-templates" Click="OpenLink">One Page Love</Hyperlink>
</TextBlock>
<TextBlock Margin="20,0,0,0">
<Hyperlink NavigateUri="https://html5up.net/" Click="OpenLink">HTML5 UP</Hyperlink>
</TextBlock>
<TextBlock Margin="20,0,0,0">
<Hyperlink NavigateUri="https://templatemo.com/" Click="OpenLink">template mo</Hyperlink>
</TextBlock>
</StackPanel>
</StackPanel>
</StackPanel>
</metro:MetroWindow>

View file

@ -173,7 +173,7 @@ namespace ProxySU_Core
{
Task.Factory.StartNew(() =>
{
project.Uninstall();
project.UninstallProxy();
});
}
@ -193,11 +193,11 @@ namespace ProxySU_Core
fileDialog.ShowDialog();
}
private void ReinstallCaddy(object sender, RoutedEventArgs e)
private void UninstallCaddy(object sender, RoutedEventArgs e)
{
Task.Factory.StartNew(() =>
{
project.ReinstallCaddy();
project.DoUninstallCaddy();
});
}

View file

@ -7,5 +7,6 @@
<package id="MaterialDesignThemes.MahApps" version="0.1.6" targetFramework="net461" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.31" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" />
<package id="QRCoder" version="1.4.1" targetFramework="net461" />
<package id="SSH.NET" version="2020.0.1" targetFramework="net461" />
</packages>