mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-10 12:40:55 +00:00
Compare commits
120 commits
Author | SHA1 | Date | |
---|---|---|---|
|
201d3da3a5 | ||
|
03f015f8d4 | ||
|
2047f3d480 | ||
|
ba5629bd49 | ||
|
97a1f45abc | ||
|
5cfe086d50 | ||
|
2d5a589bcb | ||
|
332f54224f | ||
|
be74f42f19 | ||
|
d9d9393c5f | ||
|
6e4b3f7c01 | ||
|
703183274b | ||
|
1907061064 | ||
|
6177ea99d1 | ||
|
ef3542f338 | ||
|
5cc6229437 | ||
|
705b0df116 | ||
|
8d1863729a | ||
|
8ea6af4018 | ||
|
280dacabac | ||
|
62403f68ca | ||
|
eabd976de8 | ||
|
6a67a3e685 | ||
|
1e1cad2ad7 | ||
|
f371277362 | ||
|
b9ebd8700c | ||
|
07c8d9bb2b | ||
|
1a5a7219e3 | ||
|
5db61a02b5 | ||
|
ac003d476b | ||
|
91827f47ee | ||
|
433883c3bf | ||
|
e86db631c5 | ||
|
4c0d3a0cf4 | ||
|
db6a399ca9 | ||
|
1110f8291e | ||
|
89649d136f | ||
|
89af852433 | ||
|
13e5edf50d | ||
|
5a79ceccba | ||
|
10c8c0f74e | ||
|
2567635002 | ||
|
1e96735db6 | ||
|
4d9890c797 | ||
|
d815152d2d | ||
|
ef5bb6d977 | ||
|
9f7a4b8626 | ||
|
dade426ff7 | ||
|
eaca464f9c | ||
|
bd32650fa9 | ||
|
9f4edca5d4 | ||
|
3fc01e8f2f | ||
|
c2b764a7c9 | ||
|
84674d15ac | ||
|
460b9a9abc | ||
|
6b10682060 | ||
|
1b8240b460 | ||
|
4f23cd735c | ||
|
b185e4f64e | ||
|
0937e8083d | ||
|
aaf899ea73 | ||
|
14c622b272 | ||
|
d87e4ddb96 | ||
|
62c2ad7be8 | ||
|
9cec097baa | ||
|
fcaa50b248 | ||
|
d628147bdb | ||
|
983e15f98f | ||
|
361bdb4e2d | ||
|
e7da4962e8 | ||
|
ba48b34c9a | ||
|
38784d1e4e | ||
|
682ceadd5e | ||
|
751b0d19ca | ||
|
10a62f55eb | ||
|
535998f233 | ||
|
d30ead12af | ||
|
9a552edbeb | ||
|
f0905945f6 | ||
|
bc903cbf4a | ||
|
8bc507ef43 | ||
|
dbadab1499 | ||
|
96ed54702b | ||
|
a637e6fc54 | ||
|
d3619fadd7 | ||
|
725d202b38 | ||
|
fb8a0de49d | ||
|
e1b92a499e | ||
|
9ae318c01f | ||
|
ca01190672 | ||
|
57b222bc5b | ||
|
87f01d180d | ||
|
34fb030b95 | ||
|
1792c6912a | ||
|
3e71d14424 | ||
|
e4bd5a9167 | ||
|
fc131ededd | ||
|
2cffa483aa | ||
|
524c341e9a | ||
|
d5e1125c36 | ||
|
819b8dd440 | ||
|
81ae945e4f | ||
|
553cb7b431 | ||
|
2b1e65adb4 | ||
|
7869e77126 | ||
|
6e61ef1ff6 | ||
|
be9ae4a8de | ||
|
7b7251279f | ||
|
eab70cc48c | ||
|
6c79b07d3c | ||
|
995d9ff435 | ||
|
b0d0e761de | ||
|
e85a0b93bf | ||
|
69b29fce21 | ||
|
389f80f655 | ||
|
bbf6cf64fe | ||
|
4fe8b03daa | ||
|
bbc508557b | ||
|
f39c1e70ae | ||
|
2ca98258b8 |
194 changed files with 9759 additions and 3654 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -199,3 +199,4 @@ FakesAssemblies/
|
|||
# vs code
|
||||
.vscode/*
|
||||
/ProxySU_Core/Data/Record.json
|
||||
/ProxySuper.WPF/bin
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31005.135
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31606.5
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{CE908112-DB46-4B91-8236-9139A19D66E9}"
|
||||
EndProject
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.Win32;
|
||||
using MvvmCross.Commands;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
@ -27,6 +28,8 @@ namespace ProxySuper.Core.Models.Hosts
|
|||
|
||||
public string PrivateKeyPath { get; set; }
|
||||
|
||||
public string PrivateKeyPassPhrase { get; set; }
|
||||
|
||||
public LocalProxy Proxy { get; set; }
|
||||
|
||||
public LoginSecretType SecretType { get; set; }
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace ProxySuper.Core.Models.Hosts
|
||||
using Renci.SshNet;
|
||||
|
||||
namespace ProxySuper.Core.Models.Hosts
|
||||
{
|
||||
public class LocalProxy
|
||||
{
|
||||
|
@ -6,7 +8,7 @@
|
|||
|
||||
public int Port { get; set; } = 1080;
|
||||
|
||||
public LocalProxyType Type { get; set; }
|
||||
public ProxyTypes Type { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
namespace ProxySuper.Core.Models.Hosts
|
||||
{
|
||||
public enum LocalProxyType
|
||||
{
|
||||
None = 0,
|
||||
//
|
||||
// 摘要:
|
||||
// A SOCKS4 proxy server.
|
||||
Socks4 = 1,
|
||||
//
|
||||
// 摘要:
|
||||
// A SOCKS5 proxy server.
|
||||
Socks5 = 2,
|
||||
//
|
||||
// 摘要:
|
||||
// A HTTP proxy server.
|
||||
Http = 3
|
||||
}
|
||||
}
|
83
ProxySuper.Core/Models/ProjectProgress.cs
Normal file
83
ProxySuper.Core/Models/ProjectProgress.cs
Normal file
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models
|
||||
{
|
||||
public class ProjectProgress
|
||||
{
|
||||
private string _step;
|
||||
|
||||
private string _desc;
|
||||
|
||||
private int _percentage;
|
||||
|
||||
private string _logs;
|
||||
|
||||
public ProjectProgress()
|
||||
{
|
||||
_step = "步骤";
|
||||
|
||||
_desc = "步骤描述";
|
||||
|
||||
_percentage = 0;
|
||||
|
||||
_logs = string.Empty;
|
||||
|
||||
StepUpdate = () => { };
|
||||
}
|
||||
|
||||
|
||||
public Action StepUpdate { get; set; }
|
||||
|
||||
public Action LogsUpdate { get; set; }
|
||||
|
||||
public string Desc
|
||||
{
|
||||
get { return _desc; }
|
||||
set
|
||||
{
|
||||
_desc = value;
|
||||
StepUpdate();
|
||||
|
||||
_logs += _desc + "\n";
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public string Step
|
||||
{
|
||||
get { return _step; }
|
||||
set
|
||||
{
|
||||
_step = value;
|
||||
StepUpdate();
|
||||
|
||||
_logs += Step + "\n";
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public int Percentage
|
||||
{
|
||||
get { return _percentage; }
|
||||
set
|
||||
{
|
||||
_percentage = value;
|
||||
StepUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get { return _logs; }
|
||||
set
|
||||
{
|
||||
_logs = value;
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
33
ProxySuper.Core/Models/Projects/HysteriaSettings.cs
Normal file
33
ProxySuper.Core/Models/Projects/HysteriaSettings.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class HysteriaSettings : IProjectSettings
|
||||
{
|
||||
public string Domain { get; set; } = "";
|
||||
|
||||
public string Obfs { get; set; } = "";
|
||||
|
||||
public string Email { get; set; } = "";
|
||||
|
||||
public string Protocol { get; set; } = "udp";
|
||||
|
||||
public int Port { get; set; } = 36712;
|
||||
|
||||
public int UpMbps { get; set; } = 300;
|
||||
|
||||
public int DownMbps { get; set; } = 300;
|
||||
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<int> { Port, 80 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
ProjectType Type { get; set; }
|
||||
//ProjectType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
|
|
34
ProxySuper.Core/Models/Projects/MTProtoGoSettings.cs
Normal file
34
ProxySuper.Core/Models/Projects/MTProtoGoSettings.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class MTProtoGoSettings : IProjectSettings
|
||||
{
|
||||
public MTProtoGoSettings()
|
||||
{
|
||||
Port = 443;
|
||||
|
||||
Domain = string.Empty;
|
||||
|
||||
Cleartext = "bing.com";
|
||||
|
||||
SecretText = string.Empty;
|
||||
}
|
||||
|
||||
public int Port { get; set; }
|
||||
|
||||
public string Domain { get; set; }
|
||||
|
||||
public List<int> FreePorts => new List<int> { Port };
|
||||
|
||||
public string Email => "";
|
||||
|
||||
public string Cleartext { get; set; }
|
||||
|
||||
public string SecretText { get; set; }
|
||||
}
|
||||
}
|
|
@ -6,5 +6,8 @@
|
|||
TrojanGo = 1,
|
||||
NaiveProxy = 2,
|
||||
Brook = 3,
|
||||
V2ray = 4,
|
||||
MTProtoGo = 5,
|
||||
Hysteria = 6,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public enum XrayType
|
||||
public enum RayType
|
||||
{
|
||||
// 入口
|
||||
VLESS_TCP_XTLS = 100,
|
||||
|
@ -10,6 +10,7 @@
|
|||
VLESS_WS = 102,
|
||||
VLESS_H2 = 103,
|
||||
VLESS_KCP = 104,
|
||||
VLESS_QUIC = 105,
|
||||
VLESS_gRPC = 110,
|
||||
|
||||
// VMESS 201开头
|
||||
|
@ -17,6 +18,7 @@
|
|||
VMESS_WS = 202,
|
||||
VMESS_H2 = 203,
|
||||
VMESS_KCP = 204,
|
||||
VMESS_QUIC = 205,
|
||||
|
||||
// Trojan 301开头
|
||||
Trojan_TCP = 301,
|
||||
|
@ -25,4 +27,6 @@
|
|||
// SS
|
||||
ShadowsocksAEAD = 401
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
public TrojanGoSettings()
|
||||
{
|
||||
WithTLS = true;
|
||||
Port = 443;
|
||||
WebSocketPath = "/ws";
|
||||
Password = Guid.NewGuid().ToString();
|
||||
|
@ -24,6 +25,11 @@ namespace ProxySuper.Core.Models.Projects
|
|||
|
||||
public ProjectType Type { get; set; } = ProjectType.TrojanGo;
|
||||
|
||||
/// <summary>
|
||||
/// 是否安装TLS证书
|
||||
/// </summary>
|
||||
public bool WithTLS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
|
|
187
ProxySuper.Core/Models/Projects/V2raySettings.cs
Normal file
187
ProxySuper.Core/Models/Projects/V2raySettings.cs
Normal file
|
@ -0,0 +1,187 @@
|
|||
using Newtonsoft.Json;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class V2raySettings : IProjectSettings
|
||||
{
|
||||
public static List<string> DisguiseTypes = new List<string> {
|
||||
"none",
|
||||
"srtp",
|
||||
"utp",
|
||||
"wechat-video",
|
||||
"dtls",
|
||||
"wireguard",
|
||||
};
|
||||
|
||||
public V2raySettings()
|
||||
{
|
||||
WithTLS = true;
|
||||
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
Port = 443;
|
||||
VLESS_KCP_Port = 2001;
|
||||
VLESS_QUIC_Port = 2002;
|
||||
VLESS_gRPC_Port = 2003;
|
||||
|
||||
VMESS_KCP_Port = 3001;
|
||||
VMESS_QUIC_Port = 3002;
|
||||
ShadowSocksPort = 4001;
|
||||
|
||||
UUID = guid;
|
||||
Types = new List<RayType>();
|
||||
|
||||
VLESS_WS_Path = "/" + Utils.RandomString(6);
|
||||
VLESS_KCP_Type = "none";
|
||||
VLESS_KCP_Seed = guid;
|
||||
VLESS_QUIC_Key = "";
|
||||
VLESS_QUIC_Type = "none";
|
||||
VLESS_QUIC_Security = "none";
|
||||
VLESS_QUIC_Type = "none";
|
||||
VLESS_gRPC_ServiceName = Utils.RandomString(7);
|
||||
|
||||
VMESS_WS_Path = "/" + Utils.RandomString(8);
|
||||
VMESS_TCP_Path = "/" + Utils.RandomString(9);
|
||||
VMESS_KCP_Seed = guid;
|
||||
VMESS_QUIC_Key = "";
|
||||
VMESS_KCP_Type = "none";
|
||||
VMESS_QUIC_Security = "none";
|
||||
VMESS_QUIC_Type = "none";
|
||||
|
||||
TrojanPassword = guid;
|
||||
|
||||
ShadowSocksPassword = guid;
|
||||
ShadowSocksMethod = "aes-128-gcm";
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsIPAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return IPAddress.TryParse(Domain, out _);
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new List<int>();
|
||||
list.Add(80);
|
||||
list.Add(Port);
|
||||
|
||||
if (Types.Contains(RayType.VLESS_KCP))
|
||||
{
|
||||
list.Add(VLESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VLESS_QUIC))
|
||||
{
|
||||
list.Add(VLESS_QUIC_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VMESS_KCP))
|
||||
{
|
||||
list.Add(VMESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VMESS_QUIC))
|
||||
{
|
||||
list.Add(VMESS_QUIC_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.ShadowsocksAEAD))
|
||||
{
|
||||
list.Add(ShadowSocksPort);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VLESS_gRPC))
|
||||
{
|
||||
list.Add(VLESS_gRPC_Port);
|
||||
}
|
||||
|
||||
return list.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否安装证书,
|
||||
/// 上传自有证书时选False,则不会自动安装证书。
|
||||
/// </summary>
|
||||
public bool WithTLS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UUID
|
||||
/// </summary>
|
||||
public string UUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多用户
|
||||
/// </summary>
|
||||
public List<string> MulitUUID { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 伪装域名
|
||||
/// </summary>
|
||||
public string MaskDomain { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Email
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Domain))
|
||||
{
|
||||
var arr = Domain.Split('.');
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return $"{arr[0]}@{arr[1]}.{arr[2]}";
|
||||
}
|
||||
}
|
||||
|
||||
return $"{UUID.Substring(2, 6)}@gmail.com";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安装类型
|
||||
/// </summary>
|
||||
public List<RayType> Types { get; set; } = new List<RayType>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据xray类型获取路径
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public string GetPath(RayType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RayType.VLESS_WS:
|
||||
return VLESS_WS_Path;
|
||||
case RayType.VMESS_TCP:
|
||||
return VMESS_TCP_Path;
|
||||
case RayType.VMESS_WS:
|
||||
return VMESS_WS_Path;
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class XraySettings
|
||||
public partial class V2raySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// ss password
|
||||
|
@ -19,11 +19,14 @@ namespace ProxySuper.Core.Models.Projects
|
|||
/// </summary>
|
||||
public int ShadowSocksPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// share link
|
||||
/// </summary>
|
||||
public string ShadowSocksShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.ShadowsocksAEAD, this);
|
||||
return ShareLink.Build(RayType.ShadowsocksAEAD, this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class XraySettings
|
||||
public partial class V2raySettings
|
||||
{
|
||||
public string TrojanPassword { get; set; }
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.Trojan_TCP, this);
|
||||
return ShareLink.Build(RayType.Trojan_TCP, this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +1,12 @@
|
|||
using ProxySuper.Core.Services;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class XraySettings
|
||||
public partial class V2raySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// vless xtls shareLink
|
||||
/// </summary>
|
||||
public string VLESS_TCP_XTLS_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VLESS_TCP_XTLS, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// vless tcp shareLink
|
||||
/// </summary>
|
||||
|
@ -22,7 +14,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VLESS_TCP, this);
|
||||
return ShareLink.Build(RayType.VLESS_TCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +30,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VLESS_WS, this);
|
||||
return ShareLink.Build(RayType.VLESS_WS, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +56,38 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VLESS_KCP, this);
|
||||
return ShareLink.Build(RayType.VLESS_KCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// vless quic security
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Security { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic type
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic port
|
||||
/// </summary>
|
||||
public int VLESS_QUIC_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic key
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic ShareLink
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_QUIC, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +108,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VLESS_gRPC, this);
|
||||
return ShareLink.Build(RayType.VLESS_gRPC, this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class XraySettings
|
||||
public partial class V2raySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// vmess websocket path
|
||||
|
@ -16,7 +16,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VMESS_WS, this);
|
||||
return ShareLink.Build(RayType.VMESS_WS, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VMESS_TCP, this);
|
||||
return ShareLink.Build(RayType.VMESS_TCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,38 @@ namespace ProxySuper.Core.Models.Projects
|
|||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(XrayType.VMESS_KCP, this);
|
||||
return ShareLink.Build(RayType.VMESS_KCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// vmess quic security
|
||||
/// </summary>
|
||||
public string VMESS_QUIC_Security { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess quic type
|
||||
/// </summary>
|
||||
public string VMESS_QUIC_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess quic port
|
||||
/// </summary>
|
||||
public int VMESS_QUIC_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess quic key
|
||||
/// </summary>
|
||||
public string VMESS_QUIC_Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess quic ShareLink
|
||||
/// </summary>
|
||||
public string VMESS_QUIC_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VMESS_QUIC, this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,151 +1,31 @@
|
|||
using Newtonsoft.Json;
|
||||
using ProxySuper.Core.Services;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class XraySettings : IProjectSettings
|
||||
public class XraySettings : V2raySettings
|
||||
{
|
||||
public XraySettings()
|
||||
{
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
Port = 443;
|
||||
VLESS_KCP_Port = 2001;
|
||||
VLESS_gRPC_Port = 2002;
|
||||
VMESS_KCP_Port = 3001;
|
||||
ShadowSocksPort = 4001;
|
||||
public static List<string> UTLSList = new List<string> { "", "chrome", "firefox", "safari", "ios", "android", "edge", "360", "qq", "random", "randomized" };
|
||||
|
||||
UUID = guid;
|
||||
Types = new List<XrayType>();
|
||||
//流控参数在服务端只有两种 "none", "xtls-rprx-vision",客户端可以选择三种:"none", "xtls-rprx-vision", "xtls-rprx-vision-udp443",但是选择了XTLS模式就是默认flow不为空或者"none",所以这里不再填加"none"这一项。
|
||||
public static List<string> FlowList = new List<string> { "xtls-rprx-vision", "xtls-rprx-vision-udp443" }; //{ "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-splice", "xtls-rprx-splice-udp443" };
|
||||
|
||||
VLESS_WS_Path = "/" + Utils.RandomString(6);
|
||||
VLESS_KCP_Type = "none";
|
||||
VLESS_KCP_Seed = guid;
|
||||
VLESS_gRPC_ServiceName = "/" + Utils.RandomString(7);
|
||||
public string UTLS { get; set; } = UTLSList[1];
|
||||
|
||||
VMESS_WS_Path = "/" + Utils.RandomString(8);
|
||||
VMESS_TCP_Path = "/" + Utils.RandomString(9);
|
||||
VMESS_KCP_Seed = guid;
|
||||
VMESS_KCP_Type = "none";
|
||||
public string Flow { get; set; } = FlowList[0];
|
||||
|
||||
TrojanPassword = guid;
|
||||
|
||||
ShadowSocksPassword = guid;
|
||||
ShadowSocksMethod = "aes-128-gcm";
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsIPAddress
|
||||
/// <summary>
|
||||
/// vless xtls shareLink
|
||||
/// </summary>
|
||||
public string VLESS_TCP_XTLS_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return IPAddress.TryParse(Domain, out _);
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new List<int>();
|
||||
list.Add(80);
|
||||
list.Add(443);
|
||||
|
||||
if (Types.Contains(XrayType.VLESS_KCP))
|
||||
{
|
||||
list.Add(VLESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(XrayType.VMESS_KCP))
|
||||
{
|
||||
list.Add(VMESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(XrayType.ShadowsocksAEAD))
|
||||
{
|
||||
list.Add(ShadowSocksPort);
|
||||
}
|
||||
|
||||
if (Types.Contains(XrayType.VLESS_gRPC))
|
||||
{
|
||||
list.Add(VLESS_gRPC_Port);
|
||||
}
|
||||
|
||||
return list.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectType Type { get; set; } = ProjectType.Xray;
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UUID
|
||||
/// </summary>
|
||||
public string UUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多用户
|
||||
/// </summary>
|
||||
public List<string> MulitUUID { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 伪装域名
|
||||
/// </summary>
|
||||
public string MaskDomain { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Email
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Domain))
|
||||
{
|
||||
var arr = Domain.Split('.');
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return $"{arr[0]}@{arr[1]}.{arr[2]}";
|
||||
}
|
||||
}
|
||||
|
||||
return $"{UUID.Substring(2, 6)}@gmail.com";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安装类型
|
||||
/// </summary>
|
||||
public List<XrayType> Types { get; set; } = new List<XrayType>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据xray类型获取路径
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public string GetPath(XrayType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case XrayType.VLESS_WS:
|
||||
return VLESS_WS_Path;
|
||||
case XrayType.VMESS_TCP:
|
||||
return VMESS_TCP_Path;
|
||||
case XrayType.VMESS_WS:
|
||||
return VMESS_WS_Path;
|
||||
default:
|
||||
return string.Empty;
|
||||
return ShareLink.Build(RayType.VLESS_TCP_XTLS, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
|||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace ProxySuper.Core.Models
|
||||
|
@ -32,6 +33,9 @@ namespace ProxySuper.Core.Models
|
|||
}
|
||||
}
|
||||
|
||||
[JsonProperty("v2raySettings")]
|
||||
public V2raySettings V2raySettings { get; set; }
|
||||
|
||||
[JsonProperty("settings")]
|
||||
public XraySettings XraySettings { get; set; }
|
||||
|
||||
|
@ -44,6 +48,12 @@ namespace ProxySuper.Core.Models
|
|||
[JsonProperty("brook")]
|
||||
public BrookSettings BrookSettings { get; set; }
|
||||
|
||||
[JsonProperty("mtProtoGoSettings")]
|
||||
public MTProtoGoSettings MTProtoGoSettings { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public HysteriaSettings HysteriaSettings { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public ProjectType Type
|
||||
|
@ -52,10 +62,16 @@ namespace ProxySuper.Core.Models
|
|||
{
|
||||
if (XraySettings != null) return ProjectType.Xray;
|
||||
|
||||
if (V2raySettings != null) return ProjectType.V2ray;
|
||||
|
||||
if (TrojanGoSettings != null) return ProjectType.TrojanGo;
|
||||
|
||||
if (NaiveProxySettings != null) return ProjectType.NaiveProxy;
|
||||
|
||||
if (MTProtoGoSettings != null) return ProjectType.MTProtoGo;
|
||||
|
||||
if (HysteriaSettings != null) return ProjectType.Hysteria;
|
||||
|
||||
return ProjectType.Brook;
|
||||
}
|
||||
}
|
||||
|
@ -74,8 +90,22 @@ namespace ProxySuper.Core.Models
|
|||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public Action OnSave { get; set; } = () => { };
|
||||
|
||||
public string GetShareLink()
|
||||
{
|
||||
if (Type == ProjectType.V2ray)
|
||||
{
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
V2raySettings.Types.ForEach(type =>
|
||||
{
|
||||
var link = ShareLink.Build(type, V2raySettings);
|
||||
strBuilder.AppendLine(link);
|
||||
});
|
||||
return strBuilder.ToString();
|
||||
}
|
||||
|
||||
if (Type == ProjectType.Xray)
|
||||
{
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
|
|
|
@ -32,8 +32,11 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MvvmCross, Version=7.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.7.1.2\lib\net461\MvvmCross.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MvvmCross, Version=8.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.8.0.2\lib\net461\MvvmCross.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -41,17 +44,31 @@
|
|||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="QRCoder, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.4.1\lib\net40\QRCoder.dll</HintPath>
|
||||
<Reference Include="QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.4.3\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 Include="Renci.SshNet, Version=2023.0.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SSH.NET.2023.0.0\lib\net462\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Console, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Console.4.3.1\lib\net46\System.Console.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
@ -69,49 +86,66 @@
|
|||
<Compile Include="Helpers\DateTimeUtils.cs" />
|
||||
<Compile Include="Models\Caddy.cs" />
|
||||
<Compile Include="Models\Hosts\Host.cs" />
|
||||
<Compile Include="Models\Hosts\LocalProxyType.cs" />
|
||||
<Compile Include="Models\Hosts\LoginSecretType.cs" />
|
||||
<Compile Include="Models\ProjectProgress.cs" />
|
||||
<Compile Include="Models\Projects\BrookSettings.cs" />
|
||||
<Compile Include="Models\Projects\BrookType.cs" />
|
||||
<Compile Include="Models\Projects\HysteriaSettings.cs" />
|
||||
<Compile Include="Models\Projects\IProjectSettings.cs" />
|
||||
<Compile Include="Models\Hosts\LocalProxy.cs" />
|
||||
<Compile Include="Models\Projects\MTProtoGoSettings.cs" />
|
||||
<Compile Include="Models\Projects\NaiveProxySettings.cs" />
|
||||
<Compile Include="Models\Projects\ProjectType.cs" />
|
||||
<Compile Include="Models\Projects\TrojanGoSettings.cs" />
|
||||
<Compile Include="Models\Projects\XraySettings_SS.cs" />
|
||||
<Compile Include="Models\Projects\XraySettings_Trojan.cs" />
|
||||
<Compile Include="Models\Projects\XraySettings_VLESS.cs" />
|
||||
<Compile Include="Models\Projects\V2raySettings_SS.cs" />
|
||||
<Compile Include="Models\Projects\V2raySettings_Trojan.cs" />
|
||||
<Compile Include="Models\Projects\V2raySettings_VLESS.cs" />
|
||||
<Compile Include="Models\Projects\V2raySettings.cs" />
|
||||
<Compile Include="Models\Projects\V2raySettings_VMESS.cs" />
|
||||
<Compile Include="Models\Projects\XraySettings.cs" />
|
||||
<Compile Include="Models\Projects\XraySettings_VMESS.cs" />
|
||||
<Compile Include="Models\Projects\XrayType.cs" />
|
||||
<Compile Include="Models\Projects\RayType.cs" />
|
||||
<Compile Include="Models\Record.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Helpers\Utils.cs" />
|
||||
<Compile Include="Services\BrookProject.cs" />
|
||||
<Compile Include="Services\NaiveProxyProject.cs" />
|
||||
<Compile Include="Services\ProjectBase.cs" />
|
||||
<Compile Include="Services\BrookService.cs" />
|
||||
<Compile Include="Services\HysteriaService.cs" />
|
||||
<Compile Include="Services\MTProtoGoService.cs" />
|
||||
<Compile Include="Services\NaiveProxyService.cs" />
|
||||
<Compile Include="Services\ServiceBase.cs" />
|
||||
<Compile Include="Services\ShareLink.cs" />
|
||||
<Compile Include="Services\TrojanGoConfigBuilder.cs" />
|
||||
<Compile Include="Services\TrojanGoProject.cs" />
|
||||
<Compile Include="Services\TrojanGoService.cs" />
|
||||
<Compile Include="Services\V2rayConfigBuilder.cs" />
|
||||
<Compile Include="Services\V2rayService.cs" />
|
||||
<Compile Include="Services\XrayConfigBuilder.cs" />
|
||||
<Compile Include="Services\XrayProject.cs" />
|
||||
<Compile Include="Services\XrayService.cs" />
|
||||
<Compile Include="ViewModels\BrookConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\BrookEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\BrookInstallerViewModel.cs" />
|
||||
<Compile Include="ViewModels\BrookInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\EnableRootViewModel.cs" />
|
||||
<Compile Include="ViewModels\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\HysteriaConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\HysteriaEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\HysteriaInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyInstallerViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\ShareLinkViewModel.cs" />
|
||||
<Compile Include="ViewModels\TrojanGoConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\TrojanGoEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\TrojanGoInstallerViewModel.cs" />
|
||||
<Compile Include="ViewModels\TrojanGoInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\V2rayConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\V2rayEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\V2rayInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\XrayConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\XrayEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\XrayInstallerViewModel.cs" />
|
||||
<Compile Include="ViewModels\XrayInstallViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
|
|
@ -1,128 +0,0 @@
|
|||
using ProxySuper.Core.Models.Projects;
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class BrookProject : ProjectBase<BrookSettings>
|
||||
{
|
||||
private string brookServiceTemp = @"
|
||||
[Unit]
|
||||
Description=brook service
|
||||
After=network.target syslog.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=##run_cmd##
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target";
|
||||
|
||||
public BrookProject(SshClient sshClient, BrookSettings parameters, Action<string> writeOutput) : base(sshClient, parameters, writeOutput)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Install()
|
||||
{
|
||||
|
||||
WriteOutput("检测安装系统环境...");
|
||||
EnsureSystemEnv();
|
||||
WriteOutput("检测安装系统环境完成");
|
||||
|
||||
WriteOutput("配置服务器端口...");
|
||||
ConfigFirewalld();
|
||||
WriteOutput("端口配置完成");
|
||||
|
||||
WriteOutput("安装必要的系统工具...");
|
||||
ConfigureSoftware();
|
||||
WriteOutput("系统工具安装完成");
|
||||
|
||||
WriteOutput("检测网络环境");
|
||||
EnsureIP();
|
||||
WriteOutput("检测网络环境完成");
|
||||
|
||||
if (Parameters.BrookType == BrookType.wssserver)
|
||||
{
|
||||
WriteOutput("检测域名是否绑定本机IP...");
|
||||
ValidateDomain();
|
||||
WriteOutput("域名检测完成");
|
||||
}
|
||||
|
||||
InstallBrook();
|
||||
|
||||
|
||||
Console.WriteLine("*************安装完成,尽情享用吧**********");
|
||||
}
|
||||
|
||||
public void InstallBrook()
|
||||
{
|
||||
Console.WriteLine("安装Brook");
|
||||
|
||||
string url = "https://github.com/txthinking/brook/releases/latest/download/brook_linux_amd64";
|
||||
if (ArchType == ArchType.arm)
|
||||
{
|
||||
url = url.Replace("brook_linux_amd64", "brook_linux_arm7");
|
||||
}
|
||||
|
||||
RunCmd($"curl -L {url} -o /usr/bin/brook");
|
||||
RunCmd("chmod +x /usr/bin/brook");
|
||||
Console.WriteLine("安装Brook完成");
|
||||
|
||||
var brookService = brookServiceTemp.Replace("##run_cmd##", GetRunBrookCommand());
|
||||
|
||||
RunCmd("rm -rf /etc/systemd/system/brook.service");
|
||||
RunCmd("touch /etc/systemd/system/brook.service");
|
||||
RunCmd($"echo \"{brookService}\" > /etc/systemd/system/brook.service");
|
||||
RunCmd("sudo chmod 777 /etc/systemd/system/brook.service");
|
||||
|
||||
RunCmd("systemctl enable brook");
|
||||
RunCmd("systemctl restart brook");
|
||||
|
||||
WriteOutput("********************");
|
||||
WriteOutput("安装完成,尽情想用吧~ ");
|
||||
WriteOutput("*********************");
|
||||
}
|
||||
|
||||
private string GetRunBrookCommand()
|
||||
{
|
||||
var runBrookCmd = string.Empty;
|
||||
|
||||
if (Parameters.BrookType == BrookType.server)
|
||||
{
|
||||
return $"/usr/bin/brook server --listen :{Parameters.Port} --password {Parameters.Password}";
|
||||
}
|
||||
|
||||
if (Parameters.BrookType == BrookType.wsserver)
|
||||
{
|
||||
return $"/usr/bin/brook wsserver --listen :{Parameters.Port} --password {Parameters.Password}";
|
||||
}
|
||||
|
||||
if (Parameters.BrookType == BrookType.wssserver)
|
||||
{
|
||||
return $"/usr/bin/brook wssserver --domain {Parameters.Domain} --password {Parameters.Password}";
|
||||
}
|
||||
|
||||
if (Parameters.BrookType == BrookType.socks5)
|
||||
{
|
||||
var ip = OnlyIpv6 ? IPv6 : IPv4;
|
||||
return $"/usr/bin/brook socks5 --socks5 {ip}:{Parameters.Port}";
|
||||
}
|
||||
|
||||
return runBrookCmd;
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
RunCmd("systemctl stop brook");
|
||||
RunCmd("systemctl disable brook");
|
||||
RunCmd("rm -rf /etc/systemd/system/brook.service");
|
||||
RunCmd("rm -rf /usr/bin/brook");
|
||||
|
||||
Console.WriteLine("关闭端口");
|
||||
ResetFirewalld();
|
||||
|
||||
WriteOutput("******卸载完成******");
|
||||
}
|
||||
}
|
||||
}
|
171
ProxySuper.Core/Services/BrookService.cs
Normal file
171
ProxySuper.Core/Services/BrookService.cs
Normal file
|
@ -0,0 +1,171 @@
|
|||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class BrookService : ServiceBase<BrookSettings>
|
||||
{
|
||||
private string brookServiceTemp = @"
|
||||
[Unit]
|
||||
Description=brook service
|
||||
After=network.target syslog.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=##run_cmd##
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target";
|
||||
|
||||
|
||||
public BrookService(Host host, BrookSettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "安装Brook";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
|
||||
Progress.Step = "检测网络环境";
|
||||
EnsureNetwork();
|
||||
Progress.Percentage = 60;
|
||||
if (Settings.BrookType == BrookType.wssserver)
|
||||
{
|
||||
Progress.Desc = "检测域名是否绑定本机IP";
|
||||
ValidateDomain();
|
||||
Progress.Percentage = 80;
|
||||
}
|
||||
|
||||
Progress.Step = "安装Brook服务";
|
||||
InstallBrook();
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "安装Brook成功";
|
||||
Progress.Desc = "安装Brook成功";
|
||||
|
||||
AppendCommand("分享连接:");
|
||||
AppendCommand(ShareLink.BuildBrook(Settings));
|
||||
|
||||
NavigationService.Navigate<BrookConfigViewModel, BrookSettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void InstallBrook()
|
||||
{
|
||||
Progress.Desc = "执行Brook安装文件";
|
||||
string url = "https://github.com/txthinking/brook/releases/latest/download/brook_linux_amd64";
|
||||
if (ArchType == ArchType.arm)
|
||||
{
|
||||
url = url.Replace("brook_linux_amd64", "brook_linux_arm7");
|
||||
}
|
||||
|
||||
RunCmd($"curl -L {url} -o /usr/bin/brook");
|
||||
RunCmd("chmod +x /usr/bin/brook");
|
||||
|
||||
Progress.Desc = "设置Brook服务";
|
||||
var brookService = brookServiceTemp.Replace("##run_cmd##", GetRunBrookCommand());
|
||||
|
||||
RunCmd("rm -rf /etc/systemd/system/brook.service");
|
||||
RunCmd("touch /etc/systemd/system/brook.service");
|
||||
RunCmd($"echo \"{brookService}\" > /etc/systemd/system/brook.service");
|
||||
RunCmd("sudo chmod 777 /etc/systemd/system/brook.service");
|
||||
|
||||
Progress.Desc = "启动Brook服务";
|
||||
RunCmd("systemctl enable brook");
|
||||
RunCmd("systemctl restart brook");
|
||||
}
|
||||
|
||||
private string GetRunBrookCommand()
|
||||
{
|
||||
var runBrookCmd = string.Empty;
|
||||
|
||||
if (Settings.BrookType == BrookType.server)
|
||||
{
|
||||
return $"/usr/bin/brook server --listen :{Settings.Port} --password {Settings.Password}";
|
||||
}
|
||||
|
||||
if (Settings.BrookType == BrookType.wsserver)
|
||||
{
|
||||
return $"/usr/bin/brook wsserver --listen :{Settings.Port} --password {Settings.Password}";
|
||||
}
|
||||
|
||||
if (Settings.BrookType == BrookType.wssserver)
|
||||
{
|
||||
return $"/usr/bin/brook wssserver --domain {Settings.Domain} --password {Settings.Password}";
|
||||
}
|
||||
|
||||
if (Settings.BrookType == BrookType.socks5)
|
||||
{
|
||||
var ip = IsOnlyIPv6 ? IPv6 : IPv4;
|
||||
return $"/usr/bin/brook socks5 --socks5 {ip}:{Settings.Port}";
|
||||
}
|
||||
|
||||
return runBrookCmd;
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "卸载Brook";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "停止Brook服务";
|
||||
RunCmd("systemctl stop brook");
|
||||
RunCmd("systemctl disable brook");
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Desc = "删除Brook相关文件";
|
||||
RunCmd("rm -rf /etc/systemd/system/brook.service");
|
||||
RunCmd("rm -rf /usr/bin/brook");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "重置防火墙设置";
|
||||
ResetFirewalld();
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "卸载完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
172
ProxySuper.Core/Services/HysteriaService.cs
Normal file
172
ProxySuper.Core/Services/HysteriaService.cs
Normal file
|
@ -0,0 +1,172 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using Renci.SshNet.Messages;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class HysteriaService : ServiceBase<HysteriaSettings>
|
||||
{
|
||||
public HysteriaService(Host host, HysteriaSettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void Install()
|
||||
{
|
||||
try
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
Progress.Step = "安装Hysteria";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = "检测网络环境";
|
||||
EnsureNetwork();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
|
||||
Progress.Desc = "检测域名是否绑定本机IP";
|
||||
ValidateDomain();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = "上传Hysteria配置文件";
|
||||
UploadConfigFile();
|
||||
Progress.Step = "安装Hysteria服务";
|
||||
InstallHysteria();
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "安装Hysteria成功";
|
||||
Progress.Desc = "安装Hysteria成功";
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "卸载Hysteria";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "停止Hysteria服务";
|
||||
RunCmd("systemctl stop Hysteria");
|
||||
RunCmd("systemctl disable Hysteria");
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Desc = "删除Hysteria相关文件";
|
||||
RunCmd("rm -rf /etc/systemd/system/Hysteria.service");
|
||||
RunCmd("rm -rf /usr/bin/Hysteria");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "重置防火墙设置";
|
||||
ResetFirewalld();
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "卸载完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private string HysteriaServiceTemp = @"
|
||||
[Unit]
|
||||
Description=hysteria service
|
||||
After=network.target syslog.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=##run_cmd##
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target";
|
||||
|
||||
private void InstallHysteria()
|
||||
{
|
||||
Progress.Desc = "执行Hysteria安装文件";
|
||||
string url = "https://github.com/apernet/hysteria/releases/download/v1.3.4/hysteria-linux-386";
|
||||
string targetPath = "/usr/bin/hysteria/hysteria-linux-386";
|
||||
|
||||
if (ArchType == ArchType.arm)
|
||||
{
|
||||
url = url.Replace("hysteria-linux-386", "hysteria-linux-arm");
|
||||
targetPath = targetPath.Replace("hysteria-linux-386", "hysteria-linux-arm");
|
||||
}
|
||||
|
||||
RunCmd($"curl -L {url} -o {targetPath}");
|
||||
RunCmd($"chmod +x {targetPath}");
|
||||
|
||||
Progress.Desc = "设置Hysteria服务";
|
||||
var cmd = targetPath + " -c /usr/bin/hysteria/config.json server";
|
||||
var hysteriaService = HysteriaServiceTemp.Replace("##run_cmd##", cmd);
|
||||
|
||||
RunCmd("rm -rf /etc/systemd/system/hysteria.service");
|
||||
RunCmd("touch /etc/systemd/system/hysteria.service");
|
||||
|
||||
RunCmd($"echo \"{hysteriaService}\" > /etc/systemd/system/hysteria.service");
|
||||
RunCmd("sudo chmod 777 /etc/systemd/system/hysteria.service");
|
||||
|
||||
|
||||
Progress.Desc = "启动Hysteria服务";
|
||||
RunCmd("systemctl enable hysteria");
|
||||
RunCmd("systemctl restart hysteria");
|
||||
}
|
||||
|
||||
private const string ConfigFilePath = @"Templates\Hysteria\config.json";
|
||||
private void UploadConfigFile()
|
||||
{
|
||||
var text = File.ReadAllText(ConfigFilePath, Encoding.UTF8);
|
||||
var json = JsonConvert.DeserializeObject(text);
|
||||
var obj = JToken.FromObject(json) as dynamic;
|
||||
|
||||
|
||||
obj["listen"] = $":{Settings.Port}";
|
||||
obj["acme"]["domains"][0] = Settings.Domain;
|
||||
obj["email"] = Settings.Email;
|
||||
obj["obfs"] = Settings.Obfs;
|
||||
|
||||
var configJson = JsonConvert.SerializeObject(
|
||||
obj,
|
||||
Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
});
|
||||
|
||||
RunCmd("mkdir /usr/bin/hysteria");
|
||||
WriteToFile(configJson, "/usr/bin/hysteria/config.json");
|
||||
}
|
||||
}
|
||||
}
|
160
ProxySuper.Core/Services/MTProtoGoService.cs
Normal file
160
ProxySuper.Core/Services/MTProtoGoService.cs
Normal file
|
@ -0,0 +1,160 @@
|
|||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class MTProtoGoService : ServiceBase<MTProtoGoSettings>
|
||||
{
|
||||
public MTProtoGoService(Host host, MTProtoGoSettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "1. 检测系统环境";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 15;
|
||||
|
||||
Progress.Step = "2. 安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 25;
|
||||
|
||||
Progress.Step = "3. 配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 35;
|
||||
|
||||
Progress.Step = "4. 安装docker";
|
||||
InstallDocker();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = "5. 生成密钥";
|
||||
//RunCmd("docker pull nineseconds/mtg:2"); //拉取v2版本命令,但是似乎不用也可以。
|
||||
//下面的命令是v1版本的命令格式。可以保留。将来如启用v1,可用。
|
||||
//Settings.SecretText = RunCmd($"docker run nineseconds/mtg:1 generate-secret -c {Settings.Cleartext} tls").TrimEnd('\n');
|
||||
Settings.SecretText = RunCmd($"docker run nineseconds/mtg:2 generate-secret {Settings.Cleartext}").TrimEnd('\n');
|
||||
Progress.Percentage = 65;
|
||||
|
||||
Progress.Step = "6. 生成配置文件";
|
||||
Progress.Desc = "创建配置";
|
||||
RunCmd("touch /etc/mtg.toml");
|
||||
|
||||
Progress.Desc = "写入配置内容";
|
||||
RunCmd($"echo \"secret=\\\"{Settings.SecretText}\\\"\" > /etc/mtg.toml");
|
||||
RunCmd($"echo \"bind-to=\\\"0.0.0.0:{Settings.Port}\\\"\" >> /etc/mtg.toml");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = "7. 启动MTProto服务";
|
||||
RunCmd($"docker run -d -v /etc/mtg.toml:/config.toml --name=mtg --restart=always -p {Settings.Port + ":" + Settings.Port} nineseconds/mtg:2");
|
||||
Progress.Desc = "设置自启动MTProto服务";
|
||||
|
||||
Progress.Step = "安装完成";
|
||||
Progress.Percentage = 100;
|
||||
|
||||
AppendCommand("Host: " + Settings.Domain);
|
||||
AppendCommand("Port: " + Settings.Port);
|
||||
AppendCommand("Secret: " + Settings.SecretText);
|
||||
|
||||
NavigationService.Navigate<MTProtoGoConfigViewModel, MTProtoGoSettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "卸载MTProto";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Desc = "删除docker容器";
|
||||
var cid = RunCmd("docker ps -q --filter name=mtg");
|
||||
RunCmd($"docker stop {cid}");
|
||||
RunCmd($"docker rm {cid}");
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "卸载完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSettings()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "更新MTProto配置";
|
||||
|
||||
Progress.Desc = "暂停MTProto服务";
|
||||
var cid = RunCmd("docker ps -q --filter name=mtg");
|
||||
RunCmd($"docker stop {cid}");
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Desc = "生成密钥";
|
||||
//Settings.SecretText = RunCmd($"docker run nineseconds/mtg:1 generate-secret -c {Settings.Cleartext} tls").TrimEnd('\n'); //v1版本
|
||||
Settings.SecretText = RunCmd($"docker run nineseconds/mtg:2 generate-secret {Settings.Cleartext}").TrimEnd('\n');
|
||||
Progress.Percentage = 65;
|
||||
|
||||
Progress.Desc = "修改配置文件";
|
||||
RunCmd($"echo \"secret=\\\"{Settings.SecretText}\\\"\" > /etc/mtg.toml");
|
||||
RunCmd($"echo \"bind-to=\\\"0.0.0.0:{Settings.Port}\\\"\" >> /etc/mtg.toml");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "重启MTProto服务";
|
||||
RunCmd($"docker restart {cid}");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "更新配置成功";
|
||||
|
||||
AppendCommand("Host: " + Settings.Domain);
|
||||
AppendCommand("Port: " + Settings.Port);
|
||||
AppendCommand("Secret: " + Settings.SecretText);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void InstallDocker()
|
||||
{
|
||||
Progress.Desc = "执行docker安装脚本";
|
||||
RunCmd("yes | curl https://get.docker.com | sh");
|
||||
|
||||
if (!FileExists("/usr/bin/docker"))
|
||||
{
|
||||
Progress.Desc = "docker安装失败";
|
||||
throw new Exception("docker安装失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,168 +0,0 @@
|
|||
using ProxySuper.Core.Models.Projects;
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class NaiveProxyProject : ProjectBase<NaiveProxySettings>
|
||||
{
|
||||
public NaiveProxyProject(SshClient sshClient, NaiveProxySettings parameters, Action<string> writeOutput) : base(sshClient, parameters, writeOutput)
|
||||
{
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
RunCmd("rm -rf caddy_install.sh");
|
||||
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 uninstall");
|
||||
RunCmd("rm -rf caddy_install.sh");
|
||||
WriteOutput("ProxyNaive卸载完成");
|
||||
}
|
||||
|
||||
public void UploadWeb(Stream stream)
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
UploadCaddyFile(useCustomWeb: true);
|
||||
WriteOutput("************ 上传网站模板完成 ************");
|
||||
}
|
||||
|
||||
public override void Install()
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootAuth();
|
||||
|
||||
WriteOutput("检测安装系统环境...");
|
||||
EnsureSystemEnv();
|
||||
WriteOutput("检测安装系统环境完成");
|
||||
|
||||
WriteOutput("安装必要的系统工具...");
|
||||
ConfigureSoftware();
|
||||
WriteOutput("系统工具安装完成");
|
||||
|
||||
WriteOutput("配置防火墙...");
|
||||
ConfigFirewalld();
|
||||
WriteOutput("防火墙配置完成");
|
||||
|
||||
WriteOutput("检测网络环境");
|
||||
EnsureIP();
|
||||
WriteOutput("检测网络环境完成");
|
||||
|
||||
WriteOutput("同步系统和本地时间...");
|
||||
SyncTimeDiff();
|
||||
WriteOutput("时间同步完成");
|
||||
|
||||
WriteOutput("检测域名是否绑定本机IP...");
|
||||
ValidateDomain();
|
||||
WriteOutput("域名检测完成");
|
||||
|
||||
WriteOutput("安装NaiveProxy...");
|
||||
InstallNaiveProxy();
|
||||
WriteOutput("NaiveProxy安装完成");
|
||||
|
||||
WriteOutput("启动BBR");
|
||||
EnableBBR();
|
||||
|
||||
WriteOutput("************");
|
||||
WriteOutput("安装完成,尽情享用吧......");
|
||||
WriteOutput("************");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var errorLog = "安装终止," + ex.Message;
|
||||
WriteOutput(errorLog);
|
||||
MessageBox.Show("安装失败,请联系开发者或上传日志文件(Logs文件夹下)到github提问。");
|
||||
}
|
||||
}
|
||||
|
||||
private void InstallNaiveProxy()
|
||||
{
|
||||
WriteOutput("安装 NaiveProxy");
|
||||
RunCmd(@"curl https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh yes | bash");
|
||||
// 允许开机启动
|
||||
RunCmd("systemctl enable caddy");
|
||||
UploadCaddyFile(false);
|
||||
ConfigNetwork();
|
||||
WriteOutput("NaiveProxy 安装完成");
|
||||
}
|
||||
|
||||
private void ConfigNetwork()
|
||||
{
|
||||
WriteOutput("优化网络参数");
|
||||
RunCmd(@"bash -c 'echo ""fs.file-max = 51200"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.rmem_max = 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.wmem_max = 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.rmem_default = 65536"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.wmem_default = 65536"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.netdev_max_backlog = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.somaxconn = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_syncookies = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_tw_reuse = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_tw_recycle = 0"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_fin_timeout = 30"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_keepalive_time = 1200"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.ip_local_port_range = 10000 65000"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_max_syn_backlog = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_max_tw_buckets = 5000"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_rmem = 4096 87380 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_wmem = 4096 65536 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_mtu_probing = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"sysctl -p");
|
||||
WriteOutput("网络参数优化完成");
|
||||
}
|
||||
|
||||
private void UploadCaddyFile(bool useCustomWeb = false)
|
||||
{
|
||||
var caddyStr = BuildConfig(useCustomWeb);
|
||||
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
|
||||
RunCmd($"echo {caddyStr} > /etc/caddy/Caddyfile");
|
||||
RunCmd("systemctl restart caddy");
|
||||
}
|
||||
|
||||
private string BuildConfig(bool useCustomWeb = false)
|
||||
{
|
||||
var jsonStr = File.ReadAllText("Templates/NaiveProxy/naive_server.caddyfile");
|
||||
jsonStr = jsonStr.Replace("##port##", Parameters.Port.ToString());
|
||||
jsonStr = jsonStr.Replace("##domain##", Parameters.Domain);
|
||||
jsonStr = jsonStr.Replace("##basicauth##", $"basic_auth {Parameters.UserName} {Parameters.Password}");
|
||||
|
||||
if (!useCustomWeb && !string.IsNullOrEmpty(Parameters.MaskDomain))
|
||||
{
|
||||
var prefix = "http://";
|
||||
if (Parameters.MaskDomain.StartsWith("https://"))
|
||||
{
|
||||
prefix = "https://";
|
||||
}
|
||||
var domain = Parameters.MaskDomain
|
||||
.TrimStart("http://".ToCharArray())
|
||||
.TrimStart("https://".ToCharArray());
|
||||
|
||||
jsonStr = jsonStr.Replace("##reverse_proxy##", $"reverse_proxy {prefix}{domain} {{ \n header_up Host {domain} \n }}");
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonStr = jsonStr.Replace("##reverse_proxy##", "");
|
||||
jsonStr = jsonStr.Replace("#file_server", "file_server");
|
||||
}
|
||||
return jsonStr;
|
||||
}
|
||||
}
|
||||
}
|
282
ProxySuper.Core/Services/NaiveProxyService.cs
Normal file
282
ProxySuper.Core/Services/NaiveProxyService.cs
Normal file
|
@ -0,0 +1,282 @@
|
|||
using Microsoft.Win32;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class NaiveProxyService : ServiceBase<NaiveProxySettings>
|
||||
{
|
||||
public NaiveProxyService(Host host, NaiveProxySettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var index = 1;
|
||||
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Step = $"{index++}. 安装系统必要工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Step = $"{index++}. 配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Step = $"{index++}. 检测网络环境";
|
||||
EnsureNetwork();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = $"{index++}. 检测域名是否绑定到本机";
|
||||
ValidateDomain();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
Progress.Step = $"{index++}. 安装NaiveProxy";
|
||||
InstallNaiveProxy();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 优化网络参数";
|
||||
ConfigNetwork();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Step = $"{index++}. 启动BBR";
|
||||
EnableBBR();
|
||||
|
||||
Progress.Desc = "重启Caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "NaiveProxy安装成功";
|
||||
Progress.Desc = string.Empty;
|
||||
|
||||
AppendCommand("分享连接:");
|
||||
AppendCommand(ShareLink.BuildNaiveProxy(Settings));
|
||||
|
||||
NavigationService.Navigate<NaiveProxyConfigViewModel, NaiveProxySettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "卸载NaiveProxy";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "正在卸载...";
|
||||
RunCmd("rm -rf caddy_install.sh");
|
||||
Progress.Percentage = 10;
|
||||
|
||||
RunCmd("curl -o caddy_install.sh https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh");
|
||||
Progress.Percentage = 20;
|
||||
|
||||
RunCmd("yes | bash caddy_install.sh uninstall");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
RunCmd("rm -rf caddy_install.sh");
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "卸载NaiveProxy成功";
|
||||
Progress.Desc = "卸载NaiveProxy成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSettings()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新配置";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
UploadCaddySettings();
|
||||
Progress.Desc = "重启Caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Step = "更新配置成功";
|
||||
Progress.Desc = string.Empty;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UploadWeb()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadWeb;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private void DoUploadWeb(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "上传静态网站";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "创建网站目录";
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
Progress.Percentage = 700;
|
||||
}
|
||||
|
||||
Progress.Desc = "上传Caddy配置文件";
|
||||
UploadCaddySettings(useCustomWeb: true);
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "上传静态网站成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void InstallNaiveProxy()
|
||||
{
|
||||
Progress.Desc = "下载NaiveProxy安装文件";
|
||||
RunCmd(@"curl https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh yes | bash");
|
||||
|
||||
Progress.Desc = "设置NaiveProxy开机启动";
|
||||
RunCmd("systemctl enable caddy");
|
||||
|
||||
Progress.Desc = "上传配置文件";
|
||||
UploadCaddySettings(false);
|
||||
}
|
||||
|
||||
private void ConfigNetwork()
|
||||
{
|
||||
RunCmd(@"bash -c 'echo ""fs.file-max = 51200"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.rmem_max = 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.wmem_max = 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.rmem_default = 65536"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.wmem_default = 65536"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.netdev_max_backlog = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.core.somaxconn = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_syncookies = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_tw_reuse = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_tw_recycle = 0"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_fin_timeout = 30"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_keepalive_time = 1200"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.ip_local_port_range = 10000 65000"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_max_syn_backlog = 4096"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_max_tw_buckets = 5000"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_rmem = 4096 87380 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_wmem = 4096 65536 67108864"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"bash -c 'echo ""net.ipv4.tcp_mtu_probing = 1"" >> /etc/sysctl.conf'");
|
||||
RunCmd(@"sysctl -p");
|
||||
}
|
||||
|
||||
private void UploadCaddySettings(bool useCustomWeb = false)
|
||||
{
|
||||
Progress.Desc = "生成配置文件";
|
||||
var caddyStr = BuildConfig(useCustomWeb);
|
||||
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
|
||||
Progress.Desc = "上传配置文件";
|
||||
WriteToFile(caddyStr, "/etc/caddy/Caddyfile");
|
||||
}
|
||||
|
||||
private string BuildConfig(bool useCustomWeb = false)
|
||||
{
|
||||
var jsonStr = File.ReadAllText("Templates/NaiveProxy/naive_server.caddyfile");
|
||||
jsonStr = jsonStr.Replace("##port##", Settings.Port.ToString());
|
||||
jsonStr = jsonStr.Replace("##domain##", Settings.Domain);
|
||||
jsonStr = jsonStr.Replace("##basicauth##", $"basic_auth {Settings.UserName} {Settings.Password}");
|
||||
|
||||
if (!useCustomWeb && !string.IsNullOrEmpty(Settings.MaskDomain))
|
||||
{
|
||||
var prefix = "http://";
|
||||
if (Settings.MaskDomain.StartsWith("https://"))
|
||||
{
|
||||
prefix = "https://";
|
||||
}
|
||||
var domain = Settings.MaskDomain
|
||||
.TrimStart("http://".ToCharArray())
|
||||
.TrimStart("https://".ToCharArray());
|
||||
|
||||
jsonStr = jsonStr.Replace("##reverse_proxy##", $"reverse_proxy {prefix}{domain} {{ \n header_up Host {domain} \n }}");
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonStr = jsonStr.Replace("##reverse_proxy##", "");
|
||||
jsonStr = jsonStr.Replace("#file_server", "file_server");
|
||||
}
|
||||
return jsonStr;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -69,30 +69,32 @@ namespace ProxySuper.Core.Services
|
|||
return strBuilder.ToString();
|
||||
}
|
||||
|
||||
public static string Build(XrayType xrayType, XraySettings settings)
|
||||
public static string Build(RayType xrayType, V2raySettings settings)
|
||||
{
|
||||
|
||||
switch (xrayType)
|
||||
{
|
||||
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:
|
||||
case RayType.VLESS_TCP:
|
||||
case RayType.VLESS_TCP_XTLS:
|
||||
case RayType.VLESS_WS:
|
||||
case RayType.VLESS_KCP:
|
||||
case RayType.VLESS_QUIC:
|
||||
case RayType.VLESS_gRPC:
|
||||
case RayType.Trojan_TCP:
|
||||
return BuildVlessShareLink(xrayType, settings);
|
||||
case XrayType.VMESS_TCP:
|
||||
case XrayType.VMESS_WS:
|
||||
case XrayType.VMESS_KCP:
|
||||
case RayType.VMESS_TCP:
|
||||
case RayType.VMESS_WS:
|
||||
case RayType.VMESS_KCP:
|
||||
case RayType.VMESS_QUIC:
|
||||
return BuildVmessShareLink(xrayType, settings);
|
||||
case XrayType.ShadowsocksAEAD:
|
||||
case RayType.ShadowsocksAEAD:
|
||||
return BuildShadowSocksShareLink(settings);
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private static string BuildShadowSocksShareLink(XraySettings settings)
|
||||
private static string BuildShadowSocksShareLink(V2raySettings settings)
|
||||
{
|
||||
var _method = settings.ShadowSocksMethod;
|
||||
var _password = settings.ShadowSocksPassword;
|
||||
|
@ -103,7 +105,7 @@ namespace ProxySuper.Core.Services
|
|||
return "ss://" + base64URL + "#ShadowSocks";
|
||||
}
|
||||
|
||||
private static string BuildVmessShareLink(XrayType xrayType, XraySettings settings)
|
||||
private static string BuildVmessShareLink(RayType xrayType, V2raySettings settings)
|
||||
{
|
||||
var vmess = new Vmess
|
||||
{
|
||||
|
@ -122,19 +124,19 @@ namespace ProxySuper.Core.Services
|
|||
|
||||
switch (xrayType)
|
||||
{
|
||||
case XrayType.VMESS_TCP:
|
||||
case RayType.VMESS_TCP:
|
||||
vmess.ps = "vmess-tcp-tls";
|
||||
vmess.net = "tcp";
|
||||
vmess.type = "http";
|
||||
vmess.path = settings.VMESS_TCP_Path;
|
||||
break;
|
||||
case XrayType.VMESS_WS:
|
||||
case RayType.VMESS_WS:
|
||||
vmess.ps = "vmess-ws-tls";
|
||||
vmess.net = "ws";
|
||||
vmess.type = "none";
|
||||
vmess.path = settings.VMESS_WS_Path;
|
||||
break;
|
||||
case XrayType.VMESS_KCP:
|
||||
case RayType.VMESS_KCP:
|
||||
vmess.ps = "vmess-mKCP";
|
||||
vmess.port = settings.VMESS_KCP_Port.ToString();
|
||||
vmess.net = "kcp";
|
||||
|
@ -142,6 +144,15 @@ namespace ProxySuper.Core.Services
|
|||
vmess.path = settings.VMESS_KCP_Seed;
|
||||
vmess.tls = "";
|
||||
break;
|
||||
case RayType.VMESS_QUIC:
|
||||
vmess.ps = "vmess-quic";
|
||||
vmess.port = settings.VMESS_QUIC_Port.ToString();
|
||||
vmess.net = "quic";
|
||||
vmess.type = settings.VMESS_QUIC_Type;
|
||||
vmess.path = settings.VMESS_QUIC_Key;
|
||||
vmess.host = settings.VMESS_QUIC_Security;
|
||||
vmess.tls = "tls";
|
||||
break;
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
|
@ -150,7 +161,7 @@ namespace ProxySuper.Core.Services
|
|||
return $"vmess://" + base64Url;
|
||||
}
|
||||
|
||||
private static string BuildVlessShareLink(XrayType xrayType, XraySettings settings)
|
||||
private static string BuildVlessShareLink(RayType xrayType, V2raySettings settings)
|
||||
{
|
||||
var _protocol = string.Empty;
|
||||
var _uuid = settings.UUID;
|
||||
|
@ -162,44 +173,47 @@ namespace ProxySuper.Core.Services
|
|||
var _path = "/";
|
||||
var _host = settings.Domain;
|
||||
var _descriptiveText = string.Empty;
|
||||
var _headerType = "none";
|
||||
var _seed = string.Empty;
|
||||
|
||||
switch (xrayType)
|
||||
{
|
||||
case XrayType.VLESS_TCP:
|
||||
case RayType.VLESS_TCP:
|
||||
_protocol = "vless";
|
||||
_type = "tcp";
|
||||
_descriptiveText = "vless-tcp-tls";
|
||||
break;
|
||||
case XrayType.VLESS_TCP_XTLS:
|
||||
case RayType.VLESS_TCP_XTLS:
|
||||
_protocol = "vless";
|
||||
_type = "tcp";
|
||||
_security = "xtls";
|
||||
_security = "tls";
|
||||
_descriptiveText = "vless-tcp-xtls";
|
||||
break;
|
||||
case XrayType.VLESS_WS:
|
||||
case RayType.VLESS_WS:
|
||||
_protocol = "vless";
|
||||
_type = "ws";
|
||||
_path = settings.VLESS_WS_Path;
|
||||
_descriptiveText = "vless-ws-tls";
|
||||
break;
|
||||
case XrayType.VLESS_KCP:
|
||||
case RayType.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.VLESS_gRPC:
|
||||
case RayType.VLESS_QUIC:
|
||||
_protocol = "vless";
|
||||
_port = settings.VLESS_QUIC_Port;
|
||||
_type = "quic";
|
||||
_security = "tls";
|
||||
_descriptiveText = "vless-quic";
|
||||
break;
|
||||
case RayType.VLESS_gRPC:
|
||||
_protocol = "vless";
|
||||
_type = "grpc";
|
||||
_port = settings.VLESS_gRPC_Port;
|
||||
_descriptiveText = "vless-gRPC";
|
||||
break;
|
||||
case XrayType.Trojan_TCP:
|
||||
case RayType.Trojan_TCP:
|
||||
_protocol = "trojan";
|
||||
_uuid = settings.TrojanPassword;
|
||||
_descriptiveText = "trojan-tcp";
|
||||
|
@ -210,25 +224,39 @@ namespace ProxySuper.Core.Services
|
|||
|
||||
|
||||
string parametersURL = string.Empty;
|
||||
if (xrayType != XrayType.Trojan_TCP)
|
||||
if (xrayType != RayType.Trojan_TCP)
|
||||
{
|
||||
// 4.3 传输层相关段
|
||||
parametersURL = $"?type={_type}&encryption={_encryption}&security={_security}&path={HttpUtility.UrlEncode(_path)}&headerType={_headerType}";
|
||||
parametersURL = $"?type={_type}&encryption={_encryption}&security={_security}&path={HttpUtility.UrlEncode(_path)}";
|
||||
|
||||
// kcp
|
||||
if (xrayType == XrayType.VLESS_KCP)
|
||||
if (xrayType == RayType.VLESS_KCP)
|
||||
{
|
||||
parametersURL += $"&seed={_seed}";
|
||||
parametersURL += $"&seed={settings.VLESS_KCP_Seed}&headerType={settings.VLESS_KCP_Type}";
|
||||
}
|
||||
|
||||
if (xrayType == RayType.VLESS_QUIC)
|
||||
{
|
||||
parametersURL += $"&quicSecurity={settings.VLESS_QUIC_Security}";
|
||||
if (settings.VLESS_QUIC_Security != "none")
|
||||
{
|
||||
parametersURL += $"&key={HttpUtility.UrlEncode(settings.VLESS_QUIC_Key)}";
|
||||
}
|
||||
parametersURL += $"&headerType={settings.VLESS_QUIC_Type}";
|
||||
}
|
||||
|
||||
// 4.4 TLS 相关段
|
||||
if (xrayType == XrayType.VLESS_TCP_XTLS)
|
||||
if (settings is XraySettings)
|
||||
{
|
||||
parametersURL += "&flow=xtls-rprx-direct";
|
||||
if (xrayType == RayType.VLESS_TCP_XTLS)
|
||||
{
|
||||
var xraySettings = settings as XraySettings;
|
||||
parametersURL += $"&flow={xraySettings.Flow}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (xrayType == XrayType.VLESS_gRPC)
|
||||
if (xrayType == RayType.VLESS_gRPC)
|
||||
{
|
||||
parametersURL += $"&serviceName={settings.VLESS_gRPC_ServiceName}&mode=gun";
|
||||
}
|
||||
|
|
|
@ -1,181 +0,0 @@
|
|||
using ProxySuper.Core.Models.Projects;
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class TrojanGoProject : ProjectBase<TrojanGoSettings>
|
||||
{
|
||||
public TrojanGoProject(SshClient sshClient, TrojanGoSettings parameters, Action<string> writeOutput) : base(sshClient, parameters, writeOutput)
|
||||
{
|
||||
}
|
||||
|
||||
public void InstallCertToTrojanGo()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/trojan-go",
|
||||
certName: "trojan-go.crt",
|
||||
keyName: "trojan-go.key");
|
||||
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
WriteOutput("************ 安装证书完成 ************");
|
||||
}
|
||||
|
||||
public void UploadWeb(Stream stream)
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
UploadCaddyFile(useCustomWeb: true);
|
||||
WriteOutput("************ 上传网站模板完成 ************");
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
|
||||
RunCmd("systemctl stop trojan-go");
|
||||
base.UninstallCaddy();
|
||||
|
||||
RunCmd("rm -rf /usr/local/bin/trojan-go");
|
||||
RunCmd("rm -rf /usr/local/etc/trojan-go");
|
||||
|
||||
RunCmd("acme.sh --uninstall");
|
||||
RunCmd("rm -r ~/.acme.sh");
|
||||
|
||||
WriteOutput("卸载Trojan-Go完成");
|
||||
}
|
||||
|
||||
public override void Install()
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootAuth();
|
||||
|
||||
if (FileExists("/usr/local/bin/trojan-go"))
|
||||
{
|
||||
var btnResult = MessageBox.Show("已经安装Trojan-Go,是否需要重装?", "提示", MessageBoxButton.YesNo);
|
||||
if (btnResult == MessageBoxResult.No)
|
||||
{
|
||||
MessageBox.Show("安装终止", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
WriteOutput("检测安装系统环境...");
|
||||
EnsureSystemEnv();
|
||||
WriteOutput("检测安装系统环境完成");
|
||||
|
||||
WriteOutput("安装必要的系统工具...");
|
||||
ConfigureSoftware();
|
||||
WriteOutput("系统工具安装完成");
|
||||
|
||||
WriteOutput("配置防火墙...");
|
||||
ConfigFirewalld();
|
||||
WriteOutput("防火墙配置完成");
|
||||
|
||||
WriteOutput("检测网络环境");
|
||||
EnsureIP();
|
||||
WriteOutput("检测网络环境完成");
|
||||
|
||||
WriteOutput("同步系统和本地时间...");
|
||||
SyncTimeDiff();
|
||||
WriteOutput("时间同步完成");
|
||||
|
||||
WriteOutput("检测域名是否绑定本机IP...");
|
||||
ValidateDomain();
|
||||
WriteOutput("域名检测完成");
|
||||
|
||||
WriteOutput("安装Caddy...");
|
||||
InstallCaddy();
|
||||
UploadCaddyFile();
|
||||
WriteOutput("Caddy安装完成");
|
||||
|
||||
WriteOutput("安装Trojan-Go...");
|
||||
InstallTrojanGo();
|
||||
WriteOutput("Trojan-Go安装完成");
|
||||
|
||||
|
||||
WriteOutput("启动BBR");
|
||||
EnableBBR();
|
||||
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
WriteOutput("************");
|
||||
WriteOutput("安装完成,尽情享用吧......");
|
||||
WriteOutput("************");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var errorLog = "安装终止," + ex.Message;
|
||||
WriteOutput(errorLog);
|
||||
MessageBox.Show("安装失败,请联系开发者或上传日志文件(Logs文件夹下)到github提问。");
|
||||
}
|
||||
}
|
||||
|
||||
private void InstallTrojanGo()
|
||||
{
|
||||
RunCmd(@"curl https://raw.githubusercontent.com/proxysu/shellscript/master/trojan-go.sh yes | bash");
|
||||
var success = FileExists("/usr/local/bin/trojan-go");
|
||||
if (success == false)
|
||||
{
|
||||
throw new Exception("trojan-go 安装失败,请联系开发者!");
|
||||
}
|
||||
|
||||
RunCmd($"sed -i 's/User=nobody/User=root/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"sed -i 's/CapabilityBoundingSet=/#CapabilityBoundingSet=/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"sed -i 's/AmbientCapabilities=/#AmbientCapabilities=/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"systemctl daemon-reload");
|
||||
|
||||
RunCmd("systemctl enable trojan-go");
|
||||
RunCmd("systemctl start trojan-go");
|
||||
WriteOutput("Trojan-Go 安装完成");
|
||||
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/trojan-go",
|
||||
certName: "trojan-go.crt",
|
||||
keyName: "trojan-go.key");
|
||||
|
||||
if (FileExists("/usr/local/etc/trojan-go/config.json"))
|
||||
{
|
||||
RunCmd("mv /usr/local/etc/trojan-go/config.json config.json.old");
|
||||
}
|
||||
|
||||
UploadTrojanGoSettings();
|
||||
}
|
||||
|
||||
private void UploadTrojanGoSettings()
|
||||
{
|
||||
// 上传配置
|
||||
var settings = TrojanGoConfigBuilder.BuildTrojanGoConfig(Parameters);
|
||||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(settings));
|
||||
UploadFile(stream, "/usr/local/etc/trojan-go/config.json");
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
}
|
||||
|
||||
private void UploadCaddyFile(bool useCustomWeb = false)
|
||||
{
|
||||
var config = TrojanGoConfigBuilder.BuildCaddyConfig(Parameters, useCustomWeb);
|
||||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(config));
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
UploadFile(stream, "/etc/caddy/Caddyfile");
|
||||
RunCmd("systemctl restart caddy");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
401
ProxySuper.Core/Services/TrojanGoService.cs
Normal file
401
ProxySuper.Core/Services/TrojanGoService.cs
Normal file
|
@ -0,0 +1,401 @@
|
|||
using Microsoft.Win32;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class TrojanGoService : ServiceBase<TrojanGoSettings>
|
||||
{
|
||||
public TrojanGoService(Host host, TrojanGoSettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "安装TrojanGo";
|
||||
Progress.Desc = "安装TrojanGo";
|
||||
EnsureRootUser();
|
||||
|
||||
if (FileExists("/usr/local/bin/trojan-go"))
|
||||
{
|
||||
var btnResult = MessageBox.Show("已经安装Trojan-Go,是否需要重装?", "提示", MessageBoxButton.YesNo);
|
||||
if (btnResult == MessageBoxResult.No)
|
||||
{
|
||||
MessageBox.Show("安装终止", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var index = 1;
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 10;
|
||||
|
||||
Progress.Step = $"{index++}. 安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Step = $"{index++}. 配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Step = $"{index++}. 检测网络环境";
|
||||
EnsureNetwork();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = $"{index++}. 检测域名是否解析到本机";
|
||||
ValidateDomain();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
Progress.Step = $"{index++}. 安装Caddy服务";
|
||||
InstallCaddy();
|
||||
Progress.Percentage = 70;
|
||||
|
||||
Progress.Step = $"{index++}. 安装TrojanGo";
|
||||
InstallTrojanGo();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 上传Caddy配置文件";
|
||||
UploadCaddySettings();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Step = $"{index++}. 启动BBR";
|
||||
EnableBBR();
|
||||
|
||||
Progress.Step = $"{index++}. 重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
|
||||
Progress.Desc = "启用Trojan-Go开机启动";
|
||||
RunCmd("systemctl enable trojan-go");
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
|
||||
AppendCommand("分享连接:");
|
||||
AppendCommand(ShareLink.BuildTrojanGo(Settings));
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "安装成功";
|
||||
Progress.Desc = string.Empty;
|
||||
|
||||
if (!Settings.WithTLS)
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<TrojanGoConfigViewModel, TrojanGoSettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "卸载Trojgan-Go";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "停止Trojan—Go服务";
|
||||
RunCmd("systemctl stop trojan-go");
|
||||
Progress.Percentage = 40;
|
||||
|
||||
|
||||
Progress.Desc = "卸载Caddy";
|
||||
UninstallCaddy();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
Progress.Desc = "卸载Trojan-Go";
|
||||
RunCmd("rm -rf /usr/local/bin/trojan-go");
|
||||
RunCmd("rm -rf /usr/local/etc/trojan-go");
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "删除 acme.sh";
|
||||
RunCmd("acme.sh --uninstall");
|
||||
RunCmd("rm -r ~/.acme.sh");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "卸载Trojan-Go成功";
|
||||
Progress.Desc = string.Empty;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSettings()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新配置文件";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Desc = "更新配置文件";
|
||||
UploadTrojanGoSettings();
|
||||
Progress.Percentage = 70;
|
||||
|
||||
Progress.Desc = "重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "重启Trojan-Go服务器";
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "更新配置成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UploadWeb()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadWeb;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void UploadCert()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadCert;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void ApplyForCert()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Progress.Step = "续签证书";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "安装TLS证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/trojan-go",
|
||||
certName: "trojan-go.crt",
|
||||
keyName: "trojan-go.key");
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "重启Trojan-go服务";
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "续签证书成功";
|
||||
Progress.Desc = "续签证书成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
|
||||
private void DoUploadCert(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "上传自有证书";
|
||||
Progress.Desc = "检测系统环境";
|
||||
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
var oldFileName = $"ssl_{DateTime.Now.Ticks}";
|
||||
RunCmd($"mv /usr/local/etc/trojan-go/ssl /usr/local/etc/trojan-go/{oldFileName}");
|
||||
|
||||
RunCmd("mkdir /usr/local/etc/trojan-go/ssl");
|
||||
UploadFile(stream, "/usr/local/etc/trojan-go/ssl/ssl.zip");
|
||||
RunCmd("unzip /usr/local/etc/trojan-go/ssl/ssl.zip -d /usr/local/etc/trojan-go/ssl");
|
||||
}
|
||||
|
||||
var crtFiles = RunCmd("find /usr/local/etc/trojan-go/ssl/*.crt").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
var keyFiles = RunCmd("find /usr/local/etc/trojan-go/ssl/*.key").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (crtFiles.Length > 0 && keyFiles.Length > 0)
|
||||
{
|
||||
RunCmd($"mv {crtFiles[0]} /usr/local/etc/trojan-go/ssl/trojan-go.crt");
|
||||
RunCmd($"mv {keyFiles[0]} /usr/local/etc/trojan-go/ssl/trojan-go.key");
|
||||
}
|
||||
else
|
||||
{
|
||||
Progress.Step = "上传失败";
|
||||
Progress.Desc = "上传证书失败,缺少 .crt 和 .key 文件";
|
||||
return;
|
||||
}
|
||||
|
||||
Progress.Desc = "重启trojan-go服务";
|
||||
RunCmd("systemctl restart trojan-go");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "上传证书完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DoUploadWeb(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "上传静态网站";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "创建网站目录";
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
Progress.Percentage = 700;
|
||||
}
|
||||
|
||||
Progress.Desc = "上传Caddy配置文件";
|
||||
UploadCaddySettings(useCustomWeb: true);
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "上传静态网站成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void UploadCaddySettings(bool useCustomWeb = false)
|
||||
{
|
||||
var config = TrojanGoConfigBuilder.BuildCaddyConfig(Settings, useCustomWeb);
|
||||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(config));
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
UploadFile(stream, "/etc/caddy/Caddyfile");
|
||||
}
|
||||
|
||||
private void InstallTrojanGo()
|
||||
{
|
||||
RunCmd(@"curl https://raw.githubusercontent.com/proxysu/shellscript/master/trojan-go.sh yes | bash");
|
||||
var success = FileExists("/usr/local/bin/trojan-go");
|
||||
if (success == false)
|
||||
{
|
||||
throw new Exception("trojan-go 安装失败,请联系开发者!");
|
||||
}
|
||||
|
||||
Progress.Desc = "设置Trojan-Go权限";
|
||||
RunCmd($"sed -i 's/User=nobody/User=root/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"sed -i 's/CapabilityBoundingSet=/#CapabilityBoundingSet=/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"sed -i 's/AmbientCapabilities=/#AmbientCapabilities=/g' /etc/systemd/system/trojan-go.service");
|
||||
RunCmd($"systemctl daemon-reload");
|
||||
|
||||
if (Settings.WithTLS)
|
||||
{
|
||||
Progress.Desc = "安装TLS证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/trojan-go/ssl",
|
||||
certName: "trojan-go.crt",
|
||||
keyName: "trojan-go.key");
|
||||
}
|
||||
|
||||
Progress.Desc = "上传Trojan-Go配置文件";
|
||||
UploadTrojanGoSettings();
|
||||
}
|
||||
|
||||
private void UploadTrojanGoSettings()
|
||||
{
|
||||
// 上传配置
|
||||
Progress.Desc = "生成配置文件";
|
||||
var settings = TrojanGoConfigBuilder.BuildTrojanGoConfig(Settings);
|
||||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(settings));
|
||||
|
||||
Progress.Desc = "正在上传配置文件";
|
||||
UploadFile(stream, "/usr/local/etc/trojan-go/config.json");
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
287
ProxySuper.Core/Services/V2rayConfigBuilder.cs
Normal file
287
ProxySuper.Core/Services/V2rayConfigBuilder.cs
Normal file
|
@ -0,0 +1,287 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class V2rayConfigBuilder
|
||||
{
|
||||
private const string ServerLogDir = @"Templates\v2ray\server\00_log";
|
||||
private const string ServerApiDir = @"Templates\v2ray\server\01_api";
|
||||
private const string ServerDnsDir = @"Templates\v2ray\server\02_dns";
|
||||
private const string ServerRoutingDir = @"Templates\v2ray\server\03_routing";
|
||||
private const string ServerPolicyDir = @"Templates\v2ray\server\04_policy";
|
||||
private const string ServerInboundsDir = @"Templates\v2ray\server\05_inbounds";
|
||||
private const string ServerOutboundsDir = @"Templates\v2ray\server\06_outbounds";
|
||||
private const string ServerTransportDir = @"Templates\v2ray\server\07_transport";
|
||||
private const string ServerStatsDir = @"Templates\v2ray\server\08_stats";
|
||||
private const string ServerReverseDir = @"Templates\v2ray\server\09_reverse";
|
||||
private const string CaddyFileDir = @"Templates\v2ray\caddy";
|
||||
|
||||
public static int VLESS_TCP_Port = 1110;
|
||||
public static int VLESS_WS_Port = 1111;
|
||||
public static int VLESS_H2_Port = 1112;
|
||||
|
||||
public static int VMESS_TCP_Port = 1210;
|
||||
public static int VMESS_WS_Port = 1211;
|
||||
public static int VMESS_H2_Port = 1212;
|
||||
|
||||
public static int Trojan_TCP_Port = 1310;
|
||||
public static int Trojan_WS_Port = 1311;
|
||||
|
||||
public static int FullbackPort = 8080;
|
||||
|
||||
|
||||
|
||||
public static dynamic LoadV2rayConfig()
|
||||
{
|
||||
dynamic logObj = LoadJsonObj(Path.Combine(ServerLogDir, "00_log.json"));
|
||||
dynamic apiObj = LoadJsonObj(Path.Combine(ServerApiDir, "01_api.json"));
|
||||
dynamic dnsObj = LoadJsonObj(Path.Combine(ServerDnsDir, "02_dns.json"));
|
||||
dynamic routingObj = LoadJsonObj(Path.Combine(ServerRoutingDir, "03_routing.json"));
|
||||
dynamic policyObj = LoadJsonObj(Path.Combine(ServerPolicyDir, "04_policy.json"));
|
||||
dynamic inboundsObj = LoadJsonObj(Path.Combine(ServerInboundsDir, "05_inbounds.json"));
|
||||
dynamic outboundsObj = LoadJsonObj(Path.Combine(ServerOutboundsDir, "06_outbounds.json"));
|
||||
dynamic transportObj = LoadJsonObj(Path.Combine(ServerTransportDir, "07_transport.json"));
|
||||
dynamic statsObj = LoadJsonObj(Path.Combine(ServerStatsDir, "08_stats.json"));
|
||||
dynamic reverseObj = LoadJsonObj(Path.Combine(ServerReverseDir, "09_reverse.json"));
|
||||
|
||||
return new
|
||||
{
|
||||
log = logObj["log"],
|
||||
//api = apiObj["api"], api不能为空
|
||||
dns = dnsObj["dns"],
|
||||
routing = routingObj["routing"],
|
||||
policy = policyObj["policy"],
|
||||
inbounds = inboundsObj["inbounds"],
|
||||
outbounds = outboundsObj["outbounds"],
|
||||
transport = transportObj["transport"],
|
||||
stats = statsObj["stats"],
|
||||
reverse = reverseObj["reverse"]
|
||||
};
|
||||
}
|
||||
|
||||
public static string BuildCaddyConfig(V2raySettings parameters, bool useCustomWeb = false)
|
||||
{
|
||||
var caddyStr = File.ReadAllText(Path.Combine(CaddyFileDir, "base.caddyfile"));
|
||||
caddyStr = caddyStr.Replace("##domain##", parameters.IsIPAddress ? "" : parameters.Domain);
|
||||
caddyStr = caddyStr.Replace("##port##", FullbackPort.ToString());
|
||||
|
||||
if (!useCustomWeb && !string.IsNullOrEmpty(parameters.MaskDomain))
|
||||
{
|
||||
var prefix = "http://";
|
||||
if (parameters.MaskDomain.StartsWith("https://"))
|
||||
{
|
||||
prefix = "https://";
|
||||
}
|
||||
var domain = parameters.MaskDomain
|
||||
.TrimStart("http://".ToCharArray())
|
||||
.TrimStart("https://".ToCharArray());
|
||||
|
||||
caddyStr = caddyStr.Replace("##reverse_proxy##", $"reverse_proxy {prefix}{domain} {{ \n header_up Host {domain} \n }}");
|
||||
}
|
||||
else
|
||||
{
|
||||
caddyStr = caddyStr.Replace("##reverse_proxy##", "");
|
||||
}
|
||||
|
||||
return caddyStr;
|
||||
}
|
||||
|
||||
private static void SetClients(dynamic bound, List<string> uuidList)
|
||||
{
|
||||
bound.settings.clients.Clear();
|
||||
uuidList.ForEach(id =>
|
||||
{
|
||||
object obj;
|
||||
|
||||
obj = new { id = id };
|
||||
|
||||
bound.settings.clients.Add(JToken.FromObject(obj));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static string BuildV2rayConfig(V2raySettings parameters)
|
||||
{
|
||||
var uuidList = new List<string>();
|
||||
uuidList.Add(parameters.UUID);
|
||||
uuidList.AddRange(parameters.MulitUUID);
|
||||
|
||||
var xrayConfig = LoadV2rayConfig();
|
||||
|
||||
var baseBound = GetBound("VLESS_TCP_TLS.json");
|
||||
baseBound.port = parameters.Port;
|
||||
baseBound.settings.fallbacks.Add(JToken.FromObject(new
|
||||
{
|
||||
dest = FullbackPort
|
||||
}));
|
||||
xrayConfig.inbounds.Add(baseBound);
|
||||
SetClients(baseBound, uuidList);
|
||||
|
||||
#region Fullbacks
|
||||
|
||||
if (parameters.Types.Contains(RayType.VLESS_WS))
|
||||
{
|
||||
var wsInbound = GetBound("VLESS_WS.json");
|
||||
wsInbound.port = VLESS_WS_Port;
|
||||
SetClients(wsInbound, uuidList);
|
||||
wsInbound.streamSettings.wsSettings.path = parameters.VLESS_WS_Path;
|
||||
baseBound.settings.fallbacks.Add(JToken.FromObject(new
|
||||
{
|
||||
dest = VLESS_WS_Port,
|
||||
path = parameters.VLESS_WS_Path,
|
||||
xver = 1,
|
||||
}));
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(wsInbound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(RayType.VMESS_TCP))
|
||||
{
|
||||
var mtcpBound = GetBound("VMESS_TCP.json");
|
||||
mtcpBound.port = VMESS_TCP_Port;
|
||||
SetClients(mtcpBound, uuidList);
|
||||
mtcpBound.streamSettings.tcpSettings.header.request.path = parameters.VMESS_TCP_Path;
|
||||
baseBound.settings.fallbacks.Add(JToken.FromObject(new
|
||||
{
|
||||
dest = VMESS_TCP_Port,
|
||||
path = parameters.VMESS_TCP_Path,
|
||||
xver = 1,
|
||||
}));
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(mtcpBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(RayType.VMESS_WS))
|
||||
{
|
||||
var mwsBound = GetBound("VMESS_WS.json");
|
||||
mwsBound.port = VMESS_WS_Port;
|
||||
SetClients(mwsBound, uuidList);
|
||||
mwsBound.streamSettings.wsSettings.path = parameters.VMESS_WS_Path;
|
||||
baseBound.settings.fallbacks.Add(JToken.FromObject(new
|
||||
{
|
||||
dest = VMESS_WS_Port,
|
||||
path = parameters.VMESS_WS_Path,
|
||||
xver = 1,
|
||||
}));
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(mwsBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(RayType.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,
|
||||
xver = 1,
|
||||
});
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(trojanTcpBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS GRPC
|
||||
if (parameters.Types.Contains(RayType.VLESS_gRPC))
|
||||
{
|
||||
var gRPCInBound = GetBound("VLESS_gRPC.json");
|
||||
gRPCInBound.port = parameters.VLESS_gRPC_Port;
|
||||
SetClients(gRPCInBound, uuidList);
|
||||
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
||||
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS KCP
|
||||
if (parameters.Types.Contains(RayType.VLESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VLESS_KCP.json");
|
||||
kcpBound.port = parameters.VLESS_KCP_Port;
|
||||
SetClients(kcpBound, uuidList);
|
||||
kcpBound.streamSettings.kcpSettings.header.type = parameters.VLESS_KCP_Type;
|
||||
kcpBound.streamSettings.kcpSettings.seed = parameters.VLESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS QUIC
|
||||
if (parameters.Types.Contains(RayType.VLESS_QUIC))
|
||||
{
|
||||
var quicBound = GetBound("VLESS_QUIC.json");
|
||||
quicBound.port = parameters.VLESS_QUIC_Port;
|
||||
SetClients(quicBound, uuidList);
|
||||
quicBound.streamSettings.quicSettings.security = parameters.VLESS_QUIC_Security;
|
||||
quicBound.streamSettings.quicSettings.key = parameters.VLESS_QUIC_Key;
|
||||
quicBound.streamSettings.quicSettings.header.type = parameters.VLESS_QUIC_Type;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(quicBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS KCP
|
||||
if (parameters.Types.Contains(RayType.VMESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VMESS_KCP.json");
|
||||
kcpBound.port = parameters.VMESS_KCP_Port;
|
||||
SetClients(kcpBound, uuidList);
|
||||
kcpBound.streamSettings.kcpSettings.header.type = parameters.VMESS_KCP_Type;
|
||||
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS QUIC
|
||||
if (parameters.Types.Contains(RayType.VMESS_QUIC))
|
||||
{
|
||||
var quicBound = GetBound("VMESS_QUIC.json");
|
||||
quicBound.port = parameters.VMESS_QUIC_Port;
|
||||
SetClients(quicBound, uuidList);
|
||||
quicBound.streamSettings.quicSettings.security = parameters.VMESS_QUIC_Security;
|
||||
quicBound.streamSettings.quicSettings.key = parameters.VMESS_QUIC_Key;
|
||||
quicBound.streamSettings.quicSettings.header.type = parameters.VMESS_QUIC_Type;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(quicBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Shadowsocks
|
||||
if (parameters.Types.Contains(RayType.ShadowsocksAEAD))
|
||||
{
|
||||
var ssBound = GetBound("Shadowsocks-AEAD.json");
|
||||
ssBound.port = parameters.ShadowSocksPort;
|
||||
ssBound.settings.password = parameters.ShadowSocksPassword;
|
||||
ssBound.settings.method = parameters.ShadowSocksMethod;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(ssBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
return JsonConvert.SerializeObject(
|
||||
xrayConfig,
|
||||
Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
});
|
||||
}
|
||||
|
||||
private static dynamic GetBound(string name)
|
||||
{
|
||||
return LoadJsonObj(Path.Combine(ServerInboundsDir, name));
|
||||
}
|
||||
|
||||
private static dynamic LoadJsonObj(string path)
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var jsonStr = File.ReadAllText(path, Encoding.UTF8);
|
||||
return JToken.FromObject(JsonConvert.DeserializeObject(jsonStr));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
449
ProxySuper.Core/Services/V2rayService.cs
Normal file
449
ProxySuper.Core/Services/V2rayService.cs
Normal file
|
@ -0,0 +1,449 @@
|
|||
using Microsoft.Win32;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class V2rayService : ServiceBase<V2raySettings>
|
||||
{
|
||||
public V2rayService(Host host, V2raySettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = 1;
|
||||
EnsureRootUser();
|
||||
|
||||
if (FileExists("/usr/local/bin/v2ray"))
|
||||
{
|
||||
var btnResult = MessageBox.Show("已经安装v2ray,是否需要重装?", "提示", MessageBoxButton.YesNo);
|
||||
if (btnResult == MessageBoxResult.No)
|
||||
{
|
||||
MessageBox.Show("安装终止", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 5;
|
||||
|
||||
Progress.Step = $"{index++}. 安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 15;
|
||||
|
||||
Progress.Step = $"{index++}. 配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Step = $"{index++}. 检测网络环境";
|
||||
EnsureNetwork();
|
||||
if (Settings.IsIPAddress)
|
||||
{
|
||||
Progress.Desc = ("检查域名是否解析正确");
|
||||
ValidateDomain();
|
||||
}
|
||||
Progress.Percentage = 25;
|
||||
|
||||
Progress.Step = $"{index}. 同步系统和本地时间";
|
||||
SyncTimeDiff();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Step = $"{index++}. 安装Caddy服务器";
|
||||
InstallCaddy();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = $"{index++}. 安装V2ray-Core";
|
||||
InstallV2ray();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 上传Web服务器配置";
|
||||
UploadCaddyFile();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Step = $"{index++}. 启动BBR";
|
||||
EnableBBR();
|
||||
|
||||
Progress.Desc = "重启V2ray服务";
|
||||
|
||||
RunCmd("systemctl restart caddy");
|
||||
RunCmd("systemctl restart v2ray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "安装成功";
|
||||
Progress.Desc = string.Empty;
|
||||
|
||||
if (!Settings.WithTLS)
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<V2rayConfigViewModel, V2raySettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSettings()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新V2ray配置";
|
||||
Progress.Percentage = 0;
|
||||
EnsureRootUser();
|
||||
var index = 0;
|
||||
|
||||
Progress.Desc = $"{index++}. 检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = $"{index++}. 配置防火墙";
|
||||
RunCmd("systemctl stop v2ray");
|
||||
RunCmd("systemctl stop caddy");
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = $"{index++}. 上传V2ray配置文件";
|
||||
var configJson = V2rayConfigBuilder.BuildV2rayConfig(Settings);
|
||||
WriteToFile(configJson, "/usr/local/etc/v2ray/config.json");
|
||||
Progress.Percentage = 70;
|
||||
|
||||
Progress.Desc = $"{index++}. 上传Caddy配置文件";
|
||||
UploadCaddyFile();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = $"{index++}. 重启v2ray服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
RunCmd("systemctl restart v2ray");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = ("更新配置成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateV2rayCore()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新V2ray-Core";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
EnsureRootUser();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "下载最新版本V2ray-Core";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
RunCmd("bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)");
|
||||
RunCmd("systemctl restart v2ray");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = "更新V2ray-Core成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
var index = 1;
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载Caddy服务";
|
||||
UninstallCaddy();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载V2ray服务";
|
||||
UninstallV2ray();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载Acme证书申请服务";
|
||||
UninstallAcme();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 重置防火墙端口";
|
||||
ResetFirewalld();
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Step = "卸载完成";
|
||||
Progress.Desc = "卸载完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UploadCert()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadCert;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void UploadWeb()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadWeb;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void ApplyForCert()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "续签证书";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
|
||||
Progress.Desc = "安装证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/v2ray/ssl",
|
||||
certName: "v2ray_ssl.crt",
|
||||
keyName: "v2ray_ssl.key");
|
||||
|
||||
Progress.Percentage = 90;
|
||||
Progress.Desc = "重启服务";
|
||||
RunCmd("systemctl restart v2ray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "续签证书成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#region 似有方法
|
||||
|
||||
private void DoUploadCert(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "上传自有证书";
|
||||
Progress.Desc = "检测系统环境";
|
||||
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
var oldFileName = $"ssl_{DateTime.Now.Ticks}";
|
||||
RunCmd($"mv /usr/local/etc/v2ray/ssl /usr/local/etc/v2ray/{oldFileName}");
|
||||
|
||||
RunCmd("mkdir /usr/local/etc/v2ray/ssl");
|
||||
UploadFile(stream, "/usr/local/etc/v2ray/ssl/ssl.zip");
|
||||
RunCmd("unzip /usr/local/etc/v2ray/ssl/ssl.zip -d /usr/local/etc/v2ray/ssl");
|
||||
}
|
||||
|
||||
var crtFiles = RunCmd("find /usr/local/etc/v2ray/ssl/*.crt").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
var keyFiles = RunCmd("find /usr/local/etc/v2ray/ssl/*.key").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (crtFiles.Length > 0 && keyFiles.Length > 0)
|
||||
{
|
||||
RunCmd($"mv {crtFiles[0]} /usr/local/etc/v2ray/ssl/v2ray_ssl.crt");
|
||||
RunCmd($"mv {keyFiles[0]} /usr/local/etc/v2ray/ssl/v2ray_ssl.key");
|
||||
}
|
||||
else
|
||||
{
|
||||
Progress.Step = "上传失败";
|
||||
Progress.Desc = "上传证书失败,缺少 .crt 和 .key 文件";
|
||||
return;
|
||||
}
|
||||
|
||||
Progress.Desc = "重启V2ray服务";
|
||||
RunCmd("systemctl restart v2ray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "上传证书完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DoUploadWeb(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "上传静态网站";
|
||||
Progress.Desc = "上传静态网站";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "创建网站目录";
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
}
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "上传Web配置文件";
|
||||
UploadCaddyFile(useCustomWeb: true);
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = "上传静态网站成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void InstallV2ray()
|
||||
{
|
||||
Progress.Desc = ("开始安装V2ray-Core");
|
||||
RunCmd("bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)");
|
||||
|
||||
if (!FileExists("/usr/local/bin/v2ray"))
|
||||
{
|
||||
Progress.Desc = ("V2ray-Core安装失败,请联系开发者");
|
||||
throw new Exception("V2ray-Core安装失败,请联系开发者");
|
||||
}
|
||||
|
||||
Progress.Desc = ("设置V2ray-Core权限");
|
||||
RunCmd($"sed -i 's/User=nobody/User=root/g' /etc/systemd/system/v2ray.service");
|
||||
RunCmd($"sed -i 's/CapabilityBoundingSet=/#CapabilityBoundingSet=/g' /etc/systemd/system/v2ray.service");
|
||||
RunCmd($"sed -i 's/AmbientCapabilities=/#AmbientCapabilities=/g' /etc/systemd/system/v2ray.service");
|
||||
RunCmd($"systemctl daemon-reload");
|
||||
RunCmd("systemctl enable v2ray");
|
||||
|
||||
if (FileExists("/usr/local/etc/v2ray/config.json"))
|
||||
{
|
||||
RunCmd(@"mv /usr/local/etc/v2ray/config.json /usr/local/etc/v2ray/config.json.1");
|
||||
}
|
||||
Progress.Percentage = 60;
|
||||
|
||||
if (Settings.WithTLS && !Settings.IsIPAddress)
|
||||
{
|
||||
Progress.Desc = ("安装TLS证书");
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/v2ray/ssl",
|
||||
certName: "v2ray_ssl.crt",
|
||||
keyName: "v2ray_ssl.key");
|
||||
Progress.Percentage = 75;
|
||||
}
|
||||
|
||||
Progress.Desc = ("生成v2ray服务器配置文件");
|
||||
var configJson = V2rayConfigBuilder.BuildV2rayConfig(Settings);
|
||||
WriteToFile(configJson, "/usr/local/etc/v2ray/config.json");
|
||||
}
|
||||
|
||||
private void UploadCaddyFile(bool useCustomWeb = false)
|
||||
{
|
||||
var configJson = V2rayConfigBuilder.BuildCaddyConfig(Settings, useCustomWeb);
|
||||
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
WriteToFile(configJson, "/etc/caddy/Caddyfile");
|
||||
}
|
||||
|
||||
|
||||
private void UninstallV2ray()
|
||||
{
|
||||
Progress.Desc = "关闭V2ray服务";
|
||||
RunCmd("systemctl stop v2ray");
|
||||
RunCmd("systemctl disable v2ray");
|
||||
|
||||
Progress.Desc = "卸载V2ray";
|
||||
RunCmd("bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove");
|
||||
}
|
||||
|
||||
private void UninstallAcme()
|
||||
{
|
||||
Progress.Desc = "卸载 acme.sh";
|
||||
RunCmd("acme.sh --uninstall");
|
||||
|
||||
Progress.Desc = "删除 acme.sh 相关文件";
|
||||
RunCmd("rm -rf ~/.acme.sh");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -79,7 +79,8 @@ namespace ProxySuper.Core.Services
|
|||
}
|
||||
var domain = parameters.MaskDomain
|
||||
.TrimStart("http://".ToCharArray())
|
||||
.TrimStart("https://".ToCharArray());
|
||||
.TrimStart("https://".ToCharArray())
|
||||
.TrimEnd('/');
|
||||
|
||||
caddyStr = caddyStr.Replace("##reverse_proxy##", $"reverse_proxy {prefix}{domain} {{ \n header_up Host {domain} \n }}");
|
||||
}
|
||||
|
@ -91,7 +92,7 @@ namespace ProxySuper.Core.Services
|
|||
return caddyStr;
|
||||
}
|
||||
|
||||
private static void SetClients(dynamic bound, List<string> uuidList, bool withXtls = false)
|
||||
private static void SetClients(dynamic bound, List<string> uuidList, bool withXtls = false, string flow = "")
|
||||
{
|
||||
bound.settings.clients.Clear();
|
||||
uuidList.ForEach(id =>
|
||||
|
@ -103,18 +104,19 @@ namespace ProxySuper.Core.Services
|
|||
}
|
||||
else
|
||||
{
|
||||
obj = new { id = id, flow = "xtls-rprx-direct" };
|
||||
flow = "xtls-rprx-vision";//兼容普通tls与xtls
|
||||
obj = new { id = id, flow = flow };
|
||||
}
|
||||
|
||||
bound.settings.clients.Add(JToken.FromObject(obj));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static string BuildXrayConfig(XraySettings parameters)
|
||||
{
|
||||
var uuidList = parameters.MulitUUID;
|
||||
uuidList.Insert(0, parameters.UUID);
|
||||
var uuidList = new List<string>();
|
||||
uuidList.Add(parameters.UUID);
|
||||
uuidList.AddRange(parameters.MulitUUID);
|
||||
|
||||
var xrayConfig = LoadXrayConfig();
|
||||
|
||||
|
@ -125,11 +127,11 @@ namespace ProxySuper.Core.Services
|
|||
dest = FullbackPort
|
||||
}));
|
||||
xrayConfig.inbounds.Add(baseBound);
|
||||
SetClients(baseBound, uuidList, withXtls: true);
|
||||
SetClients(baseBound, uuidList, withXtls: true, flow: parameters.Flow);
|
||||
|
||||
#region Fullbacks
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VLESS_WS))
|
||||
if (parameters.Types.Contains(RayType.VLESS_WS))
|
||||
{
|
||||
var wsInbound = GetBound("VLESS_WS.json");
|
||||
wsInbound.port = VLESS_WS_Port;
|
||||
|
@ -144,7 +146,7 @@ namespace ProxySuper.Core.Services
|
|||
xrayConfig.inbounds.Add(JToken.FromObject(wsInbound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_TCP))
|
||||
if (parameters.Types.Contains(RayType.VMESS_TCP))
|
||||
{
|
||||
var mtcpBound = GetBound("VMESS_TCP.json");
|
||||
mtcpBound.port = VMESS_TCP_Port;
|
||||
|
@ -159,7 +161,7 @@ namespace ProxySuper.Core.Services
|
|||
xrayConfig.inbounds.Add(JToken.FromObject(mtcpBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_WS))
|
||||
if (parameters.Types.Contains(RayType.VMESS_WS))
|
||||
{
|
||||
var mwsBound = GetBound("VMESS_WS.json");
|
||||
mwsBound.port = VMESS_WS_Port;
|
||||
|
@ -174,7 +176,7 @@ namespace ProxySuper.Core.Services
|
|||
xrayConfig.inbounds.Add(JToken.FromObject(mwsBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.Trojan_TCP))
|
||||
if (parameters.Types.Contains(RayType.Trojan_TCP))
|
||||
{
|
||||
var trojanTcpBound = GetBound("Trojan_TCP.json");
|
||||
trojanTcpBound.port = Trojan_TCP_Port;
|
||||
|
@ -189,7 +191,8 @@ namespace ProxySuper.Core.Services
|
|||
}
|
||||
#endregion
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
|
||||
#region VLESS GRPC
|
||||
if (parameters.Types.Contains(RayType.VLESS_gRPC))
|
||||
{
|
||||
var gRPCInBound = GetBound("VLESS_gRPC.json");
|
||||
gRPCInBound.port = parameters.VLESS_gRPC_Port;
|
||||
|
@ -198,8 +201,10 @@ namespace ProxySuper.Core.Services
|
|||
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VLESS_KCP))
|
||||
#region VLESS KCP
|
||||
if (parameters.Types.Contains(RayType.VLESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VLESS_KCP.json");
|
||||
kcpBound.port = parameters.VLESS_KCP_Port;
|
||||
|
@ -208,8 +213,23 @@ namespace ProxySuper.Core.Services
|
|||
kcpBound.streamSettings.kcpSettings.seed = parameters.VLESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_KCP))
|
||||
#region VLESS QUIC
|
||||
if (parameters.Types.Contains(RayType.VLESS_QUIC))
|
||||
{
|
||||
var quicBound = GetBound("VLESS_QUIC.json");
|
||||
quicBound.port = parameters.VLESS_QUIC_Port;
|
||||
SetClients(quicBound, uuidList);
|
||||
quicBound.streamSettings.quicSettings.security = parameters.VLESS_QUIC_Security;
|
||||
quicBound.streamSettings.quicSettings.key = parameters.VLESS_QUIC_Key;
|
||||
quicBound.streamSettings.quicSettings.header.type = parameters.VLESS_QUIC_Type;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(quicBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS KCP
|
||||
if (parameters.Types.Contains(RayType.VMESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VMESS_KCP.json");
|
||||
kcpBound.port = parameters.VMESS_KCP_Port;
|
||||
|
@ -218,15 +238,31 @@ namespace ProxySuper.Core.Services
|
|||
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (parameters.Types.Contains(XrayType.ShadowsocksAEAD))
|
||||
#region VMESS QUIC
|
||||
if (parameters.Types.Contains(RayType.VMESS_QUIC))
|
||||
{
|
||||
var quicBound = GetBound("VMESS_QUIC.json");
|
||||
quicBound.port = parameters.VMESS_QUIC_Port;
|
||||
SetClients(quicBound, uuidList);
|
||||
quicBound.streamSettings.quicSettings.security = parameters.VMESS_QUIC_Security;
|
||||
quicBound.streamSettings.quicSettings.key = parameters.VMESS_QUIC_Key;
|
||||
quicBound.streamSettings.quicSettings.header.type = parameters.VMESS_QUIC_Type;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(quicBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Shadowsocks
|
||||
if (parameters.Types.Contains(RayType.ShadowsocksAEAD))
|
||||
{
|
||||
var ssBound = GetBound("Shadowsocks-AEAD.json");
|
||||
ssBound.port = parameters.ShadowSocksPort;
|
||||
ssBound.settings.clients[0].password = parameters.ShadowSocksPassword;
|
||||
ssBound.settings.clients[0].method = parameters.ShadowSocksMethod;
|
||||
ssBound.settings.password = parameters.ShadowSocksPassword;
|
||||
ssBound.settings.method = parameters.ShadowSocksMethod;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(ssBound));
|
||||
}
|
||||
#endregion
|
||||
|
||||
return JsonConvert.SerializeObject(
|
||||
xrayConfig,
|
||||
|
|
|
@ -1,328 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class XrayProject : ProjectBase<XraySettings>
|
||||
{
|
||||
|
||||
private const string ServerLogDir = @"Templates\xray\server\00_log";
|
||||
private const string ServerApiDir = @"Templates\xray\server\01_api";
|
||||
private const string ServerDnsDir = @"Templates\xray\server\02_dns";
|
||||
private const string ServerRoutingDir = @"Templates\xray\server\03_routing";
|
||||
private const string ServerPolicyDir = @"Templates\xray\server\04_policy";
|
||||
private const string ServerInboundsDir = @"Templates\xray\server\05_inbounds";
|
||||
private const string ServerOutboundsDir = @"Templates\xray\server\06_outbounds";
|
||||
private const string ServerTransportDir = @"Templates\xray\server\07_transport";
|
||||
private const string ServerStatsDir = @"Templates\xray\server\08_stats";
|
||||
private const string ServerReverseDir = @"Templates\xray\server\09_reverse";
|
||||
private const string CaddyFileDir = @"Templates\xray\caddy";
|
||||
|
||||
public XrayProject(SshClient sshClient, XraySettings parameters, Action<string> writeOutput) : base(sshClient, parameters, writeOutput)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安装Xray
|
||||
/// </summary>
|
||||
public override void Install()
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootAuth();
|
||||
|
||||
if (FileExists("/usr/local/bin/xray"))
|
||||
{
|
||||
var btnResult = MessageBox.Show("已经安装Xray,是否需要重装?", "提示", MessageBoxButton.YesNo);
|
||||
if (btnResult == MessageBoxResult.No)
|
||||
{
|
||||
MessageBox.Show("安装终止", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
WriteOutput("检测安装系统环境...");
|
||||
EnsureSystemEnv();
|
||||
WriteOutput("检测安装系统环境完成");
|
||||
|
||||
WriteOutput("安装必要的系统工具...");
|
||||
ConfigureSoftware();
|
||||
WriteOutput("系统工具安装完成");
|
||||
|
||||
WriteOutput("配置防火墙...");
|
||||
ConfigFirewalld();
|
||||
WriteOutput("防火墙配置完成");
|
||||
|
||||
WriteOutput("检测网络环境");
|
||||
EnsureIP();
|
||||
WriteOutput("检测网络环境完成");
|
||||
|
||||
WriteOutput("同步系统和本地时间...");
|
||||
SyncTimeDiff();
|
||||
WriteOutput("时间同步完成");
|
||||
|
||||
if (!Parameters.IsIPAddress)
|
||||
{
|
||||
WriteOutput("检测域名是否绑定本机IP...");
|
||||
ValidateDomain();
|
||||
WriteOutput("域名检测完成");
|
||||
}
|
||||
|
||||
WriteOutput("安装Caddy...");
|
||||
InstallCaddy();
|
||||
WriteOutput("Caddy安装完成");
|
||||
|
||||
WriteOutput("安装Xray-Core...");
|
||||
InstallXrayWithCert();
|
||||
WriteOutput("Xray-Core安装完成");
|
||||
|
||||
WriteOutput("启动BBR");
|
||||
EnableBBR();
|
||||
|
||||
UploadCaddyFile();
|
||||
WriteOutput("************");
|
||||
WriteOutput("安装完成,尽情享用吧......");
|
||||
WriteOutput("************");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var errorLog = "安装终止," + ex.Message;
|
||||
WriteOutput(errorLog);
|
||||
MessageBox.Show("安装失败,请联系开发者或上传日志文件(Logs文件夹下)到github提问。");
|
||||
}
|
||||
}
|
||||
|
||||
public void UninstallProxy()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
WriteOutput("卸载Caddy");
|
||||
UninstallCaddy();
|
||||
WriteOutput("卸载Xray");
|
||||
UninstallXray();
|
||||
WriteOutput("卸载证书");
|
||||
UninstallAcme();
|
||||
WriteOutput("关闭端口");
|
||||
ResetFirewalld();
|
||||
|
||||
WriteOutput("************ 卸载完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新xray内核
|
||||
/// </summary>
|
||||
public void UpdateXrayCore()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ install");
|
||||
RunCmd("systemctl restart xray");
|
||||
WriteOutput("************ 更新xray内核完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新xray配置
|
||||
/// </summary>
|
||||
public void UpdateXraySettings()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
|
||||
RunCmd("systemctl stop caddy");
|
||||
RunCmd("systemctl stop xray");
|
||||
|
||||
ConfigFirewalld();
|
||||
var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters);
|
||||
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");
|
||||
|
||||
UploadCaddyFile(string.IsNullOrEmpty(Parameters.MaskDomain));
|
||||
RunCmd("systemctl restart xray");
|
||||
WriteOutput("************ 更新Xray配置成功,更新配置不包含域名,如果域名更换请重新安装。 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重装Caddy
|
||||
/// </summary>
|
||||
public void DoUninstallCaddy()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
UninstallCaddy();
|
||||
WriteOutput("************ 卸载Caddy完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安装证书
|
||||
/// </summary>
|
||||
public void InstallCertToXray()
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/xray/ssl",
|
||||
certName: "xray_ssl.crt",
|
||||
keyName: "xray_ssl.key");
|
||||
|
||||
WriteOutput("************ 安装证书完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传证书
|
||||
/// </summary>
|
||||
/// <param name="keyStrem"></param>
|
||||
/// <param name="crtStream"></param>
|
||||
public void UploadCert(Stream stream)
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
|
||||
// 转移旧文件
|
||||
var oldFileName = $"ssl_{DateTime.Now.Ticks}";
|
||||
RunCmd($"mv /usr/local/etc/xray/ssl /usr/local/etc/xray/{oldFileName}");
|
||||
|
||||
// 上传新文件
|
||||
RunCmd("mkdir /usr/local/etc/xray/ssl");
|
||||
UploadFile(stream, "/usr/local/etc/xray/ssl/ssl.zip");
|
||||
RunCmd("unzip /usr/local/etc/xray/ssl/ssl.zip -d /usr/local/etc/xray/ssl");
|
||||
|
||||
// 改名
|
||||
var crtFiles = RunCmd("find /usr/local/etc/xray/ssl/*.crt").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (crtFiles.Length > 0)
|
||||
{
|
||||
RunCmd($"mv {crtFiles[0]} /usr/local/etc/xray/ssl/xray_ssl.crt");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteOutput("************ 上传证书失败,请联系开发者 ************");
|
||||
RunCmd("rm -rf /usr/local/etc/xray/ssl");
|
||||
RunCmd($"mv /usr/local/etc/xray/ssl{oldFileName} /usr/local/etc/xray/ssl");
|
||||
WriteOutput("操作已回滚");
|
||||
return;
|
||||
}
|
||||
|
||||
var keyFiles = RunCmd("find /usr/local/etc/xray/ssl/*.key").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (keyFiles.Length > 0)
|
||||
{
|
||||
RunCmd($"mv {keyFiles[0]} /usr/local/etc/xray/ssl/xray_ssl.key");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteOutput("************ 上传证书失败,请联系开发者 ************");
|
||||
RunCmd("rm -rf /usr/local/etc/xray/ssl");
|
||||
RunCmd($"mv /usr/local/etc/xray/ssl{oldFileName} /usr/local/etc/xray/ssl");
|
||||
WriteOutput("操作已回滚");
|
||||
return;
|
||||
}
|
||||
|
||||
RunCmd("systemctl restart xray");
|
||||
WriteOutput("************ 上传证书完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传静态网站
|
||||
/// </summary>
|
||||
/// <param name="stream"></param>
|
||||
public void UploadWeb(Stream stream)
|
||||
{
|
||||
EnsureRootAuth();
|
||||
EnsureSystemEnv();
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
UploadCaddyFile(useCustomWeb: true);
|
||||
WriteOutput("************ 上传网站模板完成 ************");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传Caddy文件
|
||||
/// </summary>
|
||||
/// <param name="useCustomWeb"></param>
|
||||
private void UploadCaddyFile(bool useCustomWeb = false)
|
||||
{
|
||||
var configJson = XrayConfigBuilder.BuildCaddyConfig(Parameters, useCustomWeb);
|
||||
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
WriteToFile(configJson, "/etc/caddy/Caddyfile");
|
||||
RunCmd("systemctl restart caddy");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void UninstallXray()
|
||||
{
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ remove");
|
||||
}
|
||||
|
||||
private void UninstallAcme()
|
||||
{
|
||||
RunCmd("acme.sh --uninstall");
|
||||
RunCmd("rm -r ~/.acme.sh");
|
||||
}
|
||||
|
||||
private void InstallXrayWithCert()
|
||||
{
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ install");
|
||||
|
||||
if (!FileExists("/usr/local/bin/xray"))
|
||||
{
|
||||
WriteOutput("Xray-Core安装失败,请联系开发者");
|
||||
throw new Exception("Xray-Core安装失败,请联系开发者");
|
||||
}
|
||||
|
||||
RunCmd($"sed -i 's/User=nobody/User=root/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"sed -i 's/CapabilityBoundingSet=/#CapabilityBoundingSet=/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"sed -i 's/AmbientCapabilities=/#AmbientCapabilities=/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"systemctl daemon-reload");
|
||||
|
||||
if (FileExists("/usr/local/etc/xray/config.json"))
|
||||
{
|
||||
RunCmd(@"mv /usr/local/etc/xray/config.json /usr/local/etc/xray/config.json.1");
|
||||
}
|
||||
|
||||
if (!Parameters.IsIPAddress)
|
||||
{
|
||||
WriteOutput("安装TLS证书");
|
||||
InstallCertToXray();
|
||||
WriteOutput("TLS证书安装完成");
|
||||
}
|
||||
|
||||
var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters);
|
||||
WriteToFile(configJson, "/usr/local/etc/xray/config.json");
|
||||
RunCmd("systemctl restart xray");
|
||||
}
|
||||
|
||||
private int GetRandomPort()
|
||||
{
|
||||
var random = new Random();
|
||||
return random.Next(10001, 60000);
|
||||
}
|
||||
|
||||
private dynamic LoadJsonObj(string path)
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var jsonStr = File.ReadAllText(path, Encoding.UTF8);
|
||||
return JsonConvert.DeserializeObject(jsonStr);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
448
ProxySuper.Core/Services/XrayService.cs
Normal file
448
ProxySuper.Core/Services/XrayService.cs
Normal file
|
@ -0,0 +1,448 @@
|
|||
using Microsoft.Win32;
|
||||
using ProxySuper.Core.Helpers;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class XrayService : ServiceBase<XraySettings>
|
||||
{
|
||||
|
||||
public XrayService(Host host, XraySettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
public void Install()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = 1;
|
||||
EnsureRootUser();
|
||||
|
||||
if (FileExists("/usr/local/bin/xray"))
|
||||
{
|
||||
var btnResult = MessageBox.Show("已经安装Xray,是否需要重装?", "提示", MessageBoxButton.YesNo);
|
||||
if (btnResult == MessageBoxResult.No)
|
||||
{
|
||||
MessageBox.Show("安装终止", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 5;
|
||||
|
||||
Progress.Step = $"{index++}. 安装必要的系统工具";
|
||||
InstallSystemTools();
|
||||
Progress.Percentage = 15;
|
||||
|
||||
Progress.Step = $"{index++}. 配置防火墙";
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Step = $"{index++}. 检测网络环境";
|
||||
EnsureNetwork();
|
||||
if (Settings.IsIPAddress)
|
||||
{
|
||||
Progress.Desc = ("检查域名是否解析正确");
|
||||
ValidateDomain();
|
||||
}
|
||||
Progress.Percentage = 25;
|
||||
|
||||
Progress.Step = $"{index}. 同步系统和本地时间";
|
||||
SyncTimeDiff();
|
||||
Progress.Percentage = 30;
|
||||
|
||||
Progress.Step = $"{index++}. 安装Caddy服务器";
|
||||
InstallCaddy();
|
||||
Progress.Percentage = 50;
|
||||
|
||||
Progress.Step = $"{index++}. 安装Xray-Core";
|
||||
InstallXray();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 上传Web服务器配置";
|
||||
UploadCaddyFile();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Step = $"{index++}. 启动BBR";
|
||||
EnableBBR();
|
||||
|
||||
Progress.Desc = "重启Xray服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
RunCmd("systemctl restart xray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Step = "安装成功";
|
||||
Progress.Desc = string.Empty;
|
||||
|
||||
if (!Settings.WithTLS)
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<XrayConfigViewModel, XraySettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSettings()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新Xray配置";
|
||||
Progress.Percentage = 0;
|
||||
EnsureRootUser();
|
||||
var index = 0;
|
||||
|
||||
Progress.Desc = $"{index++}. 检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = $"{index++}. 配置防火墙";
|
||||
RunCmd("systemctl stop xray");
|
||||
RunCmd("systemctl stop caddy");
|
||||
ConfigFirewalld();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = $"{index++}. 上传Xray配置文件";
|
||||
var configJson = XrayConfigBuilder.BuildXrayConfig(Settings);
|
||||
WriteToFile(configJson, "/usr/local/etc/xray/config.json");
|
||||
Progress.Percentage = 70;
|
||||
|
||||
Progress.Desc = $"{index++}. 上传Caddy配置文件";
|
||||
UploadCaddyFile();
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = $"{index++}. 重启xray服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
RunCmd("systemctl restart xray");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = ("更新配置成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateXrayCore()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Step = "更新Xray-Core";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
EnsureRootUser();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "下载最新版本Xray-Core";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ install");
|
||||
RunCmd("systemctl restart xray");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = "更新Xray-Core成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void Uninstall()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
var index = 1;
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Step = $"{index++}. 检测系统环境";
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载Caddy服务";
|
||||
UninstallCaddy();
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载Xray服务";
|
||||
UninstallXray();
|
||||
Progress.Percentage = 60;
|
||||
|
||||
Progress.Step = $"{index++}. 卸载Acme证书申请服务";
|
||||
UninstallAcme();
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = $"{index++}. 重置防火墙端口";
|
||||
ResetFirewalld();
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Step = "卸载完成";
|
||||
Progress.Desc = "卸载完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void UploadCert()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadCert;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void UploadWeb()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "压缩文件|*.zip";
|
||||
fileDialog.FileOk += DoUploadWeb;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
public void ApplyForCert()
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "续签证书";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
|
||||
Progress.Desc = "安装证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/xray/ssl",
|
||||
certName: "xray_ssl.crt",
|
||||
keyName: "xray_ssl.key");
|
||||
|
||||
Progress.Percentage = 90;
|
||||
Progress.Desc = "重启服务";
|
||||
RunCmd("systemctl restart xray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "续签证书成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private void DoUploadCert(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "上传自有证书";
|
||||
Progress.Desc = "检测系统环境";
|
||||
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
var oldFileName = $"ssl_{DateTime.Now.Ticks}";
|
||||
RunCmd($"mv /usr/local/etc/xray/ssl /usr/local/etc/xray/{oldFileName}");
|
||||
|
||||
RunCmd("mkdir /usr/local/etc/xray/ssl");
|
||||
UploadFile(stream, "/usr/local/etc/xray/ssl/ssl.zip");
|
||||
RunCmd("unzip /usr/local/etc/xray/ssl/ssl.zip -d /usr/local/etc/xray/ssl");
|
||||
}
|
||||
|
||||
var crtFiles = RunCmd("find /usr/local/etc/xray/ssl/*.crt").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
var keyFiles = RunCmd("find /usr/local/etc/xray/ssl/*.key").Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (crtFiles.Length > 0 && keyFiles.Length > 0)
|
||||
{
|
||||
RunCmd($"mv {crtFiles[0]} /usr/local/etc/xray/ssl/xray_ssl.crt");
|
||||
RunCmd($"mv {keyFiles[0]} /usr/local/etc/xray/ssl/xray_ssl.key");
|
||||
}
|
||||
else
|
||||
{
|
||||
Progress.Step = "上传失败";
|
||||
Progress.Desc = "上传证书失败,缺少 .crt 和 .key 文件";
|
||||
return;
|
||||
}
|
||||
|
||||
Progress.Desc = "重启Xray服务";
|
||||
RunCmd("systemctl restart xray");
|
||||
|
||||
Progress.Percentage = 100;
|
||||
Progress.Desc = "上传证书完成";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DoUploadWeb(object sender, CancelEventArgs e)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "上传静态网站";
|
||||
Progress.Desc = "上传静态网站";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
Progress.Desc = "创建网站目录";
|
||||
if (!FileExists("/usr/share/caddy"))
|
||||
{
|
||||
RunCmd("mkdir /usr/share/caddy");
|
||||
}
|
||||
RunCmd("rm -rf /usr/share/caddy/*");
|
||||
Progress.Percentage = 40;
|
||||
|
||||
Progress.Desc = "正在上传文件";
|
||||
var file = sender as OpenFileDialog;
|
||||
using (var stream = file.OpenFile())
|
||||
{
|
||||
UploadFile(stream, "/usr/share/caddy/caddy.zip");
|
||||
RunCmd("unzip /usr/share/caddy/caddy.zip -d /usr/share/caddy");
|
||||
}
|
||||
RunCmd("chmod -R 777 /usr/share/caddy");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "上传Web配置文件";
|
||||
UploadCaddyFile(useCustomWeb: true);
|
||||
Progress.Percentage = 90;
|
||||
|
||||
Progress.Desc = "重启caddy服务";
|
||||
RunCmd("systemctl restart caddy");
|
||||
Progress.Percentage = 100;
|
||||
|
||||
Progress.Desc = "上传静态网站成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void InstallXray()
|
||||
{
|
||||
Progress.Desc = ("开始安装Xray-Core");
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ install");
|
||||
|
||||
if (!FileExists("/usr/local/bin/xray"))
|
||||
{
|
||||
Progress.Desc = ("Xray-Core安装失败,请联系开发者");
|
||||
throw new Exception("Xray-Core安装失败,请联系开发者");
|
||||
}
|
||||
|
||||
Progress.Desc = ("设置Xray-core权限");
|
||||
RunCmd($"sed -i 's/User=nobody/User=root/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"sed -i 's/CapabilityBoundingSet=/#CapabilityBoundingSet=/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"sed -i 's/AmbientCapabilities=/#AmbientCapabilities=/g' /etc/systemd/system/xray.service");
|
||||
RunCmd($"systemctl daemon-reload");
|
||||
|
||||
if (FileExists("/usr/local/etc/xray/config.json"))
|
||||
{
|
||||
RunCmd(@"mv /usr/local/etc/xray/config.json /usr/local/etc/xray/config.json.1");
|
||||
}
|
||||
Progress.Percentage = 60;
|
||||
|
||||
if (Settings.WithTLS && !Settings.IsIPAddress)
|
||||
{
|
||||
Progress.Desc = ("安装TLS证书");
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/xray/ssl",
|
||||
certName: "xray_ssl.crt",
|
||||
keyName: "xray_ssl.key");
|
||||
Progress.Percentage = 75;
|
||||
}
|
||||
|
||||
Progress.Desc = ("生成Xray服务器配置文件");
|
||||
var configJson = XrayConfigBuilder.BuildXrayConfig(Settings);
|
||||
WriteToFile(configJson, "/usr/local/etc/xray/config.json");
|
||||
}
|
||||
|
||||
private void UploadCaddyFile(bool useCustomWeb = false)
|
||||
{
|
||||
var configJson = XrayConfigBuilder.BuildCaddyConfig(Settings, useCustomWeb);
|
||||
|
||||
if (FileExists("/etc/caddy/Caddyfile"))
|
||||
{
|
||||
RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back");
|
||||
}
|
||||
WriteToFile(configJson, "/etc/caddy/Caddyfile");
|
||||
}
|
||||
|
||||
private void UninstallXray()
|
||||
{
|
||||
Progress.Desc = "关闭Xray服务";
|
||||
RunCmd("systemctl stop xray");
|
||||
RunCmd("systemctl disable xray");
|
||||
|
||||
Progress.Desc = "卸载Xray";
|
||||
RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ remove");
|
||||
}
|
||||
|
||||
private void UninstallAcme()
|
||||
{
|
||||
Progress.Desc = "卸载 acme.sh";
|
||||
RunCmd("acme.sh --uninstall");
|
||||
|
||||
Progress.Desc = "删除 acme.sh 相关文件";
|
||||
RunCmd("rm -rf ~/.acme.sh");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -67,6 +67,8 @@ namespace ProxySuper.Core.ViewModels
|
|||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(() => Save());
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
|
@ -84,5 +86,17 @@ namespace ProxySuper.Core.ViewModels
|
|||
BrookSettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
private void SaveAndInstall()
|
||||
{
|
||||
var record = new Record
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
BrookSettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<BrookInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
65
ProxySuper.Core/ViewModels/BrookInstallViewModel.cs
Normal file
65
ProxySuper.Core/ViewModels/BrookInstallViewModel.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class BrookInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
BrookSettings _settings;
|
||||
|
||||
BrookService _service;
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.BrookSettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_service = new BrookService(_host, _settings);
|
||||
_service.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_service.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_service.Connect();
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_service.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public ProjectProgress Progress => _service.Progress;
|
||||
|
||||
public string Logs => _service.Progress.Logs;
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_service.Install);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_service.Uninstall);
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = System.IO.Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".brook.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class BrookInstallerViewModel : MvxViewModel<Record>
|
||||
{
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public BrookSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
Host = record.Host;
|
||||
Settings = record.BrookSettings;
|
||||
}
|
||||
|
||||
private bool _connected;
|
||||
public bool Connected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
set
|
||||
{
|
||||
_connected = value;
|
||||
RaisePropertyChanged("Connected");
|
||||
}
|
||||
}
|
||||
|
||||
public string CommandText { get; set; }
|
||||
}
|
||||
}
|
|
@ -145,7 +145,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
auth = new PrivateKeyAuthenticationMethod(host.UserName, new PrivateKeyFile(host.PrivateKeyPath));
|
||||
}
|
||||
|
||||
if (host.Proxy.Type == LocalProxyType.None)
|
||||
if (host.Proxy.Type == ProxyTypes.None)
|
||||
{
|
||||
return new ConnectionInfo(host.Address, host.Port, host.UserName, auth);
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
host: host.Address,
|
||||
port: host.Port,
|
||||
username: host.UserName,
|
||||
proxyType: (ProxyTypes)(int)host.Proxy.Type,
|
||||
proxyType: host.Proxy.Type,
|
||||
proxyHost: host.Proxy.Address,
|
||||
proxyPort: host.Proxy.Port,
|
||||
proxyUsername: host.Proxy.UserName,
|
||||
|
|
|
@ -53,19 +53,63 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
});
|
||||
if (!Directory.Exists("Data"))
|
||||
{
|
||||
Directory.CreateDirectory("Data");
|
||||
}
|
||||
File.WriteAllText("Data/Record.json", json);
|
||||
}
|
||||
|
||||
public void SortDone(string id)
|
||||
{
|
||||
var item = Records.Where(x => x.Id == id).FirstOrDefault();
|
||||
if (item == null) return;
|
||||
|
||||
var index = Records.IndexOf(item);
|
||||
if (index >= Records.Count - 1) return;
|
||||
|
||||
Records.Remove(item);
|
||||
Records.Insert(index + 1, item);
|
||||
|
||||
RaisePropertyChanged("Records");
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
public void SortUp(string id)
|
||||
{
|
||||
var item = Records.Where(x => x.Id == id).FirstOrDefault();
|
||||
if (item == null) return;
|
||||
|
||||
var index = Records.IndexOf(item);
|
||||
if (index <= 0) return;
|
||||
|
||||
Records.Remove(item);
|
||||
Records.Insert(index - 1, item);
|
||||
|
||||
RaisePropertyChanged("Records");
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
public MvxObservableCollection<Record> Records { get; set; }
|
||||
|
||||
public IMvxCommand SortUpCommand => new MvxCommand<string>(SortUp);
|
||||
|
||||
public IMvxCommand SortDoneCommand => new MvxCommand<string>(SortDone);
|
||||
|
||||
public IMvxCommand AddV2rayCommand => new MvxAsyncCommand(AddV2rayRecord);
|
||||
|
||||
public IMvxCommand AddXrayCommand => new MvxAsyncCommand(AddXrayRecord);
|
||||
|
||||
public IMvxCommand AddTrojanGoCommand => new MvxAsyncCommand(AddTrojanGoRecord);
|
||||
|
||||
public IMvxCommand AddNaiveProxyCommand => new MvxAsyncCommand(AddNaiveProxyRecord);
|
||||
|
||||
public IMvxCommand AddMTProtoGoCommand => new MvxAsyncCommand(AddMTProtoGoRecord);
|
||||
|
||||
public IMvxCommand AddBrookCommand => new MvxAsyncCommand(AddBrookRecord);
|
||||
|
||||
public IMvxCommand AddHysteriaCommand => new MvxAsyncCommand(AddHysteriaRecord);
|
||||
|
||||
public IMvxCommand RemoveCommand => new MvxAsyncCommand<string>(DeleteRecord);
|
||||
|
||||
public IMvxCommand EditCommand => new MvxAsyncCommand<string>(EditRecord);
|
||||
|
@ -74,6 +118,20 @@ namespace ProxySuper.Core.ViewModels
|
|||
|
||||
public IMvxCommand InstallCommand => new MvxAsyncCommand<string>(GoToInstall);
|
||||
|
||||
public async Task AddV2rayRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
record.Id = Utils.GetTickID();
|
||||
record.Host = new Host();
|
||||
record.V2raySettings = new V2raySettings();
|
||||
|
||||
var result = await _navigationService.Navigate<V2rayEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
Records.Add(result);
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
public async Task AddXrayRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
|
@ -103,6 +161,21 @@ namespace ProxySuper.Core.ViewModels
|
|||
SaveToJson();
|
||||
}
|
||||
|
||||
public async Task AddMTProtoGoRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
record.Id = Utils.GetTickID();
|
||||
record.Host = new Host();
|
||||
record.MTProtoGoSettings = new MTProtoGoSettings();
|
||||
|
||||
var result = await _navigationService.Navigate<MTProtoGoEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
Records.Add(result);
|
||||
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
public async Task AddNaiveProxyRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
|
@ -133,6 +206,21 @@ namespace ProxySuper.Core.ViewModels
|
|||
SaveToJson();
|
||||
}
|
||||
|
||||
public async Task AddHysteriaRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
record.Id = Utils.GetTickID();
|
||||
record.Host = new Host();
|
||||
record.HysteriaSettings = new HysteriaSettings();
|
||||
|
||||
var result = await _navigationService.Navigate<HysteriaEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
Records.Add(result);
|
||||
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
|
||||
public async Task EditRecord(string id)
|
||||
{
|
||||
|
@ -140,6 +228,14 @@ namespace ProxySuper.Core.ViewModels
|
|||
if (record == null) return;
|
||||
|
||||
Record result = null;
|
||||
if (record.Type == ProjectType.V2ray)
|
||||
{
|
||||
result = await _navigationService.Navigate<V2rayEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
record.Host = result.Host;
|
||||
record.V2raySettings = result.V2raySettings;
|
||||
}
|
||||
if (record.Type == ProjectType.Xray)
|
||||
{
|
||||
result = await _navigationService.Navigate<XrayEditorViewModel, Record, Record>(record);
|
||||
|
@ -172,6 +268,22 @@ namespace ProxySuper.Core.ViewModels
|
|||
record.Host = result.Host;
|
||||
record.BrookSettings = result.BrookSettings;
|
||||
}
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
result = await _navigationService.Navigate<MTProtoGoEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
record.Host = result.Host;
|
||||
record.MTProtoGoSettings = result.MTProtoGoSettings;
|
||||
}
|
||||
if (record.Type == ProjectType.Hysteria)
|
||||
{
|
||||
result = await _navigationService.Navigate<HysteriaEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
record.Host = result.Host;
|
||||
record.HysteriaSettings = result.HysteriaSettings;
|
||||
}
|
||||
|
||||
SaveToJson();
|
||||
}
|
||||
|
@ -196,6 +308,10 @@ namespace ProxySuper.Core.ViewModels
|
|||
var record = Records.FirstOrDefault(x => x.Id == id);
|
||||
if (record == null) return;
|
||||
|
||||
if (record.Type == ProjectType.V2ray)
|
||||
{
|
||||
await _navigationService.Navigate<V2rayConfigViewModel, V2raySettings>(record.V2raySettings);
|
||||
}
|
||||
if (record.Type == ProjectType.Xray)
|
||||
{
|
||||
await _navigationService.Navigate<XrayConfigViewModel, XraySettings>(record.XraySettings);
|
||||
|
@ -212,29 +328,53 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
await _navigationService.Navigate<BrookConfigViewModel, BrookSettings>(record.BrookSettings);
|
||||
}
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
await _navigationService.Navigate<MTProtoGoConfigViewModel, MTProtoGoSettings>(record.MTProtoGoSettings);
|
||||
}
|
||||
if (record.Type == ProjectType.Hysteria)
|
||||
{
|
||||
await _navigationService.Navigate<HysteriaConfigViewModel, HysteriaSettings>(record.HysteriaSettings);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task GoToInstall(string id)
|
||||
{
|
||||
var record = Records.FirstOrDefault(x => x.Id == id);
|
||||
if (record == null) return;
|
||||
record.OnSave = SaveToJson;
|
||||
|
||||
if (record.Type == ProjectType.V2ray)
|
||||
{
|
||||
await _navigationService.Navigate<V2rayInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.Xray)
|
||||
{
|
||||
await _navigationService.Navigate<XrayInstallerViewModel, Record>(record);
|
||||
await _navigationService.Navigate<XrayInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.TrojanGo)
|
||||
{
|
||||
await _navigationService.Navigate<TrojanGoInstallerViewModel, Record>(record);
|
||||
await _navigationService.Navigate<TrojanGoInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.NaiveProxy)
|
||||
{
|
||||
await _navigationService.Navigate<NaiveProxyInstallerViewModel, Record>(record);
|
||||
await _navigationService.Navigate<NaiveProxyInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.Brook)
|
||||
{
|
||||
await _navigationService.Navigate<BrookInstallerViewModel, Record>(record);
|
||||
await _navigationService.Navigate<BrookInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
await _navigationService.Navigate<MTProtoGoInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.Hysteria)
|
||||
{
|
||||
await _navigationService.Navigate<HysteriaInstallViewModel, Record>(record);
|
||||
}
|
||||
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
45
ProxySuper.Core/ViewModels/HysteriaConfigViewModel.cs
Normal file
45
ProxySuper.Core/ViewModels/HysteriaConfigViewModel.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using Newtonsoft.Json;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class HysteriaConfigViewModel : MvxViewModel<HysteriaSettings>
|
||||
{
|
||||
public HysteriaSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(HysteriaSettings parameter)
|
||||
{
|
||||
Settings = parameter;
|
||||
}
|
||||
|
||||
public string ClientJson {
|
||||
|
||||
get
|
||||
{
|
||||
var jsonData = new
|
||||
{
|
||||
server = $"{Settings.Domain}:{Settings.Port}",
|
||||
obfs = Settings.Obfs,
|
||||
up_mbps = 10,
|
||||
down_mbps = 50,
|
||||
socks5 = new
|
||||
{
|
||||
listen = "127.0.0.1:1080"
|
||||
},
|
||||
http = new
|
||||
{
|
||||
listen = "127.0.0.1:1081"
|
||||
}
|
||||
};
|
||||
|
||||
return JsonConvert.SerializeObject(jsonData, Formatting.Indented);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
68
ProxySuper.Core/ViewModels/HysteriaEditorViewModel.cs
Normal file
68
ProxySuper.Core/ViewModels/HysteriaEditorViewModel.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.Navigation;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class HysteriaEditorViewModel : MvxViewModel<Record, Record>
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public HysteriaSettings Settings { get; set; }
|
||||
|
||||
public IMvxNavigationService NavigationService { get; }
|
||||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(() => Save());
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public HysteriaEditorViewModel(IMvxNavigationService mvxNavigationService)
|
||||
{
|
||||
NavigationService = mvxNavigationService;
|
||||
}
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
|
||||
Id = record.Id;
|
||||
Host = record.Host;
|
||||
Settings = record.HysteriaSettings;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
NavigationService.Close(this, new Record
|
||||
{
|
||||
Id = Id,
|
||||
Host = Host,
|
||||
HysteriaSettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveAndInstall()
|
||||
{
|
||||
var record = new Record
|
||||
{
|
||||
Id = Id,
|
||||
Host = Host,
|
||||
HysteriaSettings = Settings,
|
||||
};
|
||||
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<HysteriaInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
}
|
66
ProxySuper.Core/ViewModels/HysteriaInstallViewModel.cs
Normal file
66
ProxySuper.Core/ViewModels/HysteriaInstallViewModel.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class HysteriaInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
public Host _host { get; set; }
|
||||
|
||||
public HysteriaSettings _settings { get; set; }
|
||||
|
||||
public HysteriaService _service { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.HysteriaSettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_service = new HysteriaService(_host, _settings);
|
||||
_service.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_service.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_service.Connect();
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_service.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public ProjectProgress Progress => _service.Progress;
|
||||
|
||||
public string Logs => _service.Progress.Logs;
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_service.Install);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_service.Uninstall);
|
||||
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = System.IO.Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".hysteria.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
21
ProxySuper.Core/ViewModels/MTProtoGoConfigViewModel.cs
Normal file
21
ProxySuper.Core/ViewModels/MTProtoGoConfigViewModel.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProtoGoConfigViewModel : MvxViewModel<MTProtoGoSettings>
|
||||
{
|
||||
public MTProtoGoSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(MTProtoGoSettings parameter)
|
||||
{
|
||||
Settings = parameter;
|
||||
}
|
||||
}
|
||||
}
|
66
ProxySuper.Core/ViewModels/MTProtoGoEditorViewModel.cs
Normal file
66
ProxySuper.Core/ViewModels/MTProtoGoEditorViewModel.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.Navigation;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProtoGoEditorViewModel : MvxViewModel<Record, Record>
|
||||
{
|
||||
public MTProtoGoEditorViewModel(IMvxNavigationService navigationService)
|
||||
{
|
||||
NavigationService = navigationService;
|
||||
}
|
||||
|
||||
public IMvxNavigationService NavigationService { get; }
|
||||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(Save);
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public MTProtoGoSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
|
||||
Id = record.Id;
|
||||
Host = record.Host;
|
||||
Settings = record.MTProtoGoSettings;
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
NavigationService.Close(this, new Record
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
MTProtoGoSettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
private void SaveAndInstall()
|
||||
{
|
||||
var record = new Record
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
MTProtoGoSettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<MTProtoGoInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
}
|
94
ProxySuper.Core/ViewModels/MTProtoGoInstallViewModel.cs
Normal file
94
ProxySuper.Core/ViewModels/MTProtoGoInstallViewModel.cs
Normal file
|
@ -0,0 +1,94 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProtoGoInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
MTProtoGoSettings _settings;
|
||||
|
||||
MTProtoGoService _mtproxyService;
|
||||
|
||||
Action _onSave;
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.MTProtoGoSettings;
|
||||
_onSave = parameter.OnSave;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_mtproxyService = new MTProtoGoService(_host, _settings);
|
||||
_mtproxyService.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_mtproxyService.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_mtproxyService.Connect();
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_mtproxyService.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public ProjectProgress Progress
|
||||
{
|
||||
get => _mtproxyService.Progress;
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get => _mtproxyService.Progress.Logs;
|
||||
}
|
||||
|
||||
|
||||
#region Command
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(() =>
|
||||
{
|
||||
_mtproxyService.Install();
|
||||
|
||||
// 安装时生成的Secret需要保存
|
||||
_onSave();
|
||||
});
|
||||
|
||||
public IMvxCommand UpdateSettingsCommand => new MvxCommand(() =>
|
||||
{
|
||||
_mtproxyService.UpdateSettings();
|
||||
|
||||
// 安装时生成的Secret需要保存
|
||||
_onSave();
|
||||
});
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_mtproxyService.Uninstall);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = System.IO.Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".mtproxy-go.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,6 +35,8 @@ namespace ProxySuper.Core.ViewModels
|
|||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(Save);
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
private void Save()
|
||||
{
|
||||
NavigationService.Close(this, new Record
|
||||
|
@ -44,5 +46,18 @@ namespace ProxySuper.Core.ViewModels
|
|||
NaiveProxySettings = Settings
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void SaveAndInstall()
|
||||
{
|
||||
var record = new Record
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
NaiveProxySettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<NaiveProxyInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
75
ProxySuper.Core/ViewModels/NaiveProxyInstallViewModel.cs
Normal file
75
ProxySuper.Core/ViewModels/NaiveProxyInstallViewModel.cs
Normal file
|
@ -0,0 +1,75 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class NaiveProxyInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
NaiveProxySettings _settings;
|
||||
|
||||
NaiveProxyService _service;
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.NaiveProxySettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_service = new NaiveProxyService(_host, _settings);
|
||||
_service.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_service.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_service.Connect();
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_service.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
|
||||
public ProjectProgress Progress => _service.Progress;
|
||||
|
||||
public string Logs => _service.Progress.Logs;
|
||||
|
||||
|
||||
#region Commands
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_service.Install);
|
||||
|
||||
public IMvxCommand UpdateSettingsCommand => new MvxCommand(_service.UpdateSettings);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_service.Uninstall);
|
||||
|
||||
public IMvxCommand UploadWebCommand => new MvxCommand(_service.UploadWeb);
|
||||
|
||||
#endregion
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = System.IO.Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".naiveproxy.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class NaiveProxyInstallerViewModel : MvxViewModel<Record>
|
||||
{
|
||||
public Host Host { get; set; }
|
||||
|
||||
public NaiveProxySettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
Host = record.Host;
|
||||
Settings = record.NaiveProxySettings;
|
||||
}
|
||||
|
||||
private bool _connected;
|
||||
public bool Connected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
set
|
||||
{
|
||||
_connected = value;
|
||||
RaisePropertyChanged("Connected");
|
||||
}
|
||||
}
|
||||
|
||||
public string CommandText { get; set; }
|
||||
|
||||
}
|
||||
}
|
|
@ -19,6 +19,8 @@ namespace ProxySuper.Core.ViewModels
|
|||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(Save);
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
@ -43,6 +45,18 @@ namespace ProxySuper.Core.ViewModels
|
|||
TrojanGoSettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
private void SaveAndInstall()
|
||||
{
|
||||
var record = new Record
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
TrojanGoSettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<TrojanGoInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
85
ProxySuper.Core/ViewModels/TrojanGoInstallViewModel.cs
Normal file
85
ProxySuper.Core/ViewModels/TrojanGoInstallViewModel.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class TrojanGoInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
TrojanGoSettings _settings;
|
||||
|
||||
TrojanGoService _trojanGoService;
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.TrojanGoSettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_trojanGoService = new TrojanGoService(_host, _settings);
|
||||
_trojanGoService.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_trojanGoService.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_trojanGoService.Connect();
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_trojanGoService.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public ProjectProgress Progress
|
||||
{
|
||||
get => _trojanGoService.Progress;
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get => _trojanGoService.Progress.Logs;
|
||||
}
|
||||
|
||||
|
||||
#region Command
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_trojanGoService.Install);
|
||||
|
||||
public IMvxCommand UpdateSettingsCommand => new MvxCommand(_trojanGoService.UpdateSettings);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_trojanGoService.Uninstall);
|
||||
|
||||
public IMvxCommand UploadCertCommand => new MvxCommand(_trojanGoService.UploadCert);
|
||||
|
||||
public IMvxCommand UploadWebCommand => new MvxCommand(_trojanGoService.UploadWeb);
|
||||
|
||||
public IMvxCommand ApplyForCertCommand => new MvxCommand(_trojanGoService.ApplyForCert);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = System.IO.Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".trojan-go.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class TrojanGoInstallerViewModel : MvxViewModel<Record>
|
||||
{
|
||||
public Host Host { get; set; }
|
||||
|
||||
public TrojanGoSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
Host = record.Host;
|
||||
Settings = record.TrojanGoSettings;
|
||||
}
|
||||
|
||||
private bool _connected;
|
||||
public bool Connected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
set
|
||||
{
|
||||
_connected = value;
|
||||
RaisePropertyChanged("Connected");
|
||||
}
|
||||
}
|
||||
|
||||
public string CommandText { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
109
ProxySuper.Core/ViewModels/V2rayConfigViewModel.cs
Normal file
109
ProxySuper.Core/ViewModels/V2rayConfigViewModel.cs
Normal file
|
@ -0,0 +1,109 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class V2rayConfigViewModel : MvxViewModel<V2raySettings>
|
||||
{
|
||||
public V2raySettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(V2raySettings parameter)
|
||||
{
|
||||
Settings = parameter;
|
||||
}
|
||||
|
||||
|
||||
public bool Checked_VLESS_TCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_WS
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_WS);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_KCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_KCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_QUIC
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_QUIC);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_gRPC
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_gRPC);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VMESS_TCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VMESS_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VMESS_WS
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VMESS_WS);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VMESS_KCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VMESS_KCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VMESS_QUIC
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VMESS_QUIC);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_Trojan_TCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.Trojan_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckedShadowSocks
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.ShadowsocksAEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
572
ProxySuper.Core/ViewModels/V2rayEditorViewModel.cs
Normal file
572
ProxySuper.Core/ViewModels/V2rayEditorViewModel.cs
Normal file
|
@ -0,0 +1,572 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.Navigation;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public partial class V2rayEditorViewModel : MvxViewModel<Record, Record>
|
||||
{
|
||||
public V2rayEditorViewModel(IMvxNavigationService navigationService)
|
||||
{
|
||||
NavigationService = navigationService;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public V2raySettings Settings { get; set; }
|
||||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(Save);
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public IMvxNavigationService NavigationService { get; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
Id = record.Id;
|
||||
Host = record.Host;
|
||||
Settings = record.V2raySettings;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
NavigationService.Close(this, new Record()
|
||||
{
|
||||
Id = Id,
|
||||
Host = Host,
|
||||
V2raySettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveAndInstall()
|
||||
{
|
||||
var record = new Record()
|
||||
{
|
||||
Id = Id,
|
||||
Host = Host,
|
||||
V2raySettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<V2rayInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class V2rayEditorViewModel
|
||||
{
|
||||
public List<string> KcpTypes => V2raySettings.DisguiseTypes;
|
||||
|
||||
public List<string> QuicTypes => V2raySettings.DisguiseTypes;
|
||||
|
||||
/// <summary>
|
||||
/// https://www.v2ray.com/chapter_02/transport/quic.html
|
||||
/// </summary>
|
||||
public List<string> QuicSecurities => new List<string> {
|
||||
"none",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// https://www.v2ray.com/chapter_02/protocols/shadowsocks.html
|
||||
/// </summary>
|
||||
public List<string> ShadowSocksMethods => new List<string> {
|
||||
"aes-256-cfb",
|
||||
"aes-128-cfb",
|
||||
"chacha20",
|
||||
"chacha20-ietf",
|
||||
"aes-256-gcm",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305"
|
||||
};
|
||||
|
||||
public IMvxCommand RandomUuid => new MvxCommand(() => GetUuid());
|
||||
|
||||
public bool WithTLS
|
||||
{
|
||||
get => Settings.WithTLS;
|
||||
set
|
||||
{
|
||||
Settings.WithTLS = value;
|
||||
RaisePropertyChanged("Port");
|
||||
}
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
get => Settings.Port;
|
||||
set
|
||||
{
|
||||
Settings.Port = value;
|
||||
RaisePropertyChanged("Port");
|
||||
}
|
||||
}
|
||||
|
||||
public int VLESS_KCP_Port
|
||||
{
|
||||
get => Settings.VLESS_KCP_Port;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_KCP_Port = value;
|
||||
RaisePropertyChanged("VLESS_KCP_Port");
|
||||
}
|
||||
}
|
||||
|
||||
public int VMESS_KCP_Port
|
||||
{
|
||||
get => Settings.VMESS_KCP_Port;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_KCP_Port = value;
|
||||
RaisePropertyChanged("VMESS_KCP_Port");
|
||||
}
|
||||
}
|
||||
|
||||
public string UUID
|
||||
{
|
||||
get => Settings.UUID;
|
||||
set
|
||||
{
|
||||
Settings.UUID = value;
|
||||
RaisePropertyChanged("UUID");
|
||||
}
|
||||
}
|
||||
|
||||
public string MultiUUID
|
||||
{
|
||||
get => string.Join(",", Settings.MulitUUID);
|
||||
set
|
||||
{
|
||||
var input = value.Replace(',', ',');
|
||||
var arr = input.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
arr.RemoveAll(x => x == this.UUID);
|
||||
Settings.MulitUUID = arr;
|
||||
RaisePropertyChanged("MultiUUID");
|
||||
}
|
||||
}
|
||||
|
||||
public string Domain
|
||||
{
|
||||
get => Settings.Domain;
|
||||
set
|
||||
{
|
||||
Settings.Domain = value;
|
||||
RaisePropertyChanged("Domain");
|
||||
}
|
||||
}
|
||||
|
||||
public string MaskDomain
|
||||
{
|
||||
get => Settings.MaskDomain;
|
||||
set
|
||||
{
|
||||
Settings.MaskDomain = value;
|
||||
RaisePropertyChanged("MaskDomain");
|
||||
}
|
||||
}
|
||||
|
||||
#region Torjan
|
||||
public string TrojanPassword
|
||||
{
|
||||
get => Settings.TrojanPassword;
|
||||
set => Settings.TrojanPassword = value;
|
||||
}
|
||||
public bool Checked_Trojan_TCP
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.Trojan_TCP);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
if (!Settings.Types.Contains(RayType.Trojan_TCP))
|
||||
Settings.Types.Add(RayType.Trojan_TCP);
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.Types.Remove(RayType.Trojan_TCP);
|
||||
}
|
||||
RaisePropertyChanged("Checked_Trojan_TCP");
|
||||
}
|
||||
}
|
||||
public string Trojan_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.Trojan_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ShadowSocks
|
||||
public int ShadowSocksPort
|
||||
{
|
||||
get => Settings.ShadowSocksPort;
|
||||
set
|
||||
{
|
||||
Settings.ShadowSocksPort = value;
|
||||
RaisePropertyChanged("ShadowSocksPort");
|
||||
}
|
||||
}
|
||||
public bool CheckedShadowSocks
|
||||
{
|
||||
|
||||
get => Settings.Types.Contains(RayType.ShadowsocksAEAD);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.ShadowsocksAEAD);
|
||||
RaisePropertyChanged("CheckedShadowSocks");
|
||||
}
|
||||
}
|
||||
|
||||
public string ShadowSocksPassword
|
||||
{
|
||||
get => Settings.ShadowSocksPassword;
|
||||
set => Settings.ShadowSocksPassword = value;
|
||||
}
|
||||
public string ShadowSocksMethod
|
||||
{
|
||||
get => Settings.ShadowSocksMethod;
|
||||
set
|
||||
{
|
||||
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
|
||||
var trimValue = value.Replace(namespaceStr, "");
|
||||
trimValue = trimValue.Trim();
|
||||
Settings.ShadowSocksMethod = trimValue;
|
||||
RaisePropertyChanged("ShadowSocksMethod");
|
||||
}
|
||||
}
|
||||
public string ShadowSocksShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.ShadowsocksAEAD, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
private void CheckBoxChanged(bool value, RayType type)
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
if (!Settings.Types.Contains(type))
|
||||
{
|
||||
Settings.Types.Add(type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.Types.RemoveAll(x => x == type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void GetUuid()
|
||||
{
|
||||
UUID = Guid.NewGuid().ToString();
|
||||
RaisePropertyChanged("UUID");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// VMESS SETTINGS
|
||||
/// </summary>
|
||||
public partial class V2rayEditorViewModel
|
||||
{
|
||||
#region VMESS TCP
|
||||
public bool Checked_VMESS_TCP
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VMESS_TCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VMESS_TCP);
|
||||
RaisePropertyChanged("Checked_VMESS_TCP");
|
||||
}
|
||||
}
|
||||
public string VMESS_TCP_Path
|
||||
{
|
||||
get => Settings.VMESS_TCP_Path;
|
||||
set => Settings.VMESS_TCP_Path = value;
|
||||
}
|
||||
public string VMESS_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VMESS_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS WS
|
||||
public bool Checked_VMESS_WS
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VMESS_WS);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VMESS_WS);
|
||||
RaisePropertyChanged("Checked_VMESS_WS");
|
||||
}
|
||||
}
|
||||
public string VMESS_WS_Path
|
||||
{
|
||||
get => Settings.VMESS_WS_Path;
|
||||
set => Settings.VMESS_WS_Path = value;
|
||||
}
|
||||
public string VMESS_WS_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VMESS_WS, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS KCP
|
||||
public string VMESS_KCP_Seed
|
||||
{
|
||||
get => Settings.VMESS_KCP_Seed;
|
||||
set => Settings.VMESS_KCP_Seed = value;
|
||||
}
|
||||
public string VMESS_KCP_Type
|
||||
{
|
||||
get => Settings.VMESS_KCP_Type;
|
||||
set
|
||||
{
|
||||
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
|
||||
var trimValue = value.Replace(namespaceStr, "");
|
||||
trimValue = trimValue.Trim();
|
||||
Settings.VMESS_KCP_Type = trimValue;
|
||||
RaisePropertyChanged("VMESS_KCP_Type");
|
||||
}
|
||||
}
|
||||
public bool Checked_VMESS_KCP
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VMESS_KCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VMESS_KCP);
|
||||
RaisePropertyChanged("Checked_VMESS_KCP");
|
||||
}
|
||||
}
|
||||
public string VMESS_KCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VMESS_KCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS QUIC
|
||||
public bool Checked_VMESS_QUIC
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VMESS_QUIC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VMESS_QUIC);
|
||||
RaisePropertyChanged(nameof(Checked_VMESS_QUIC));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Key
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Key;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Key = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Key));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Security
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Security;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Security = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Security));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Type
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Type;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Type = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Type));
|
||||
}
|
||||
}
|
||||
public int VMESS_QUIC_Port
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Port;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Port = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Port));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VMESS_QUIC, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// VLESS SETTINGS
|
||||
/// </summary>
|
||||
public partial class V2rayEditorViewModel
|
||||
{
|
||||
#region VLESS TCP
|
||||
public bool Checked_VLESS_TCP
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VLESS_TCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_TCP);
|
||||
RaisePropertyChanged("Checked_VLESS_TCP");
|
||||
}
|
||||
}
|
||||
public string VLESS_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS WS
|
||||
public string VLESS_WS_Path
|
||||
{
|
||||
get => Settings.VLESS_WS_Path;
|
||||
set => Settings.VLESS_WS_Path = value;
|
||||
}
|
||||
public bool Checked_VLESS_WS
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_WS);
|
||||
}
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_WS);
|
||||
RaisePropertyChanged("Checked_VLESS_WS");
|
||||
}
|
||||
}
|
||||
public string VLESS_WS_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_WS, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 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;
|
||||
RaisePropertyChanged("VLESS_KCP_Type");
|
||||
}
|
||||
}
|
||||
public bool Checked_VLESS_KCP
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VLESS_KCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_KCP);
|
||||
RaisePropertyChanged("Checked_VLESS_KCP");
|
||||
}
|
||||
}
|
||||
public string VLESS_KCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_KCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS QUIC
|
||||
public bool Checked_VLESS_QUIC
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VLESS_QUIC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_QUIC);
|
||||
RaisePropertyChanged(nameof(Checked_VLESS_QUIC));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_Key
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Key; set
|
||||
{
|
||||
Settings.VLESS_QUIC_Key = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Key));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_Security
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Security;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Security = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Security));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_Type
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Type;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Type = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Type));
|
||||
}
|
||||
}
|
||||
public int VLESS_QUIC_Port
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Port;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Port = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Port));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_QUIC, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 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(RayType.VLESS_gRPC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_gRPC);
|
||||
RaisePropertyChanged("Checked_VLESS_gRPC");
|
||||
}
|
||||
}
|
||||
public string VLESS_gRPC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_gRPC, Settings);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
88
ProxySuper.Core/ViewModels/V2rayInstallViewModel.cs
Normal file
88
ProxySuper.Core/ViewModels/V2rayInstallViewModel.cs
Normal file
|
@ -0,0 +1,88 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class V2rayInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
V2raySettings _settings;
|
||||
|
||||
V2rayService _service;
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_service.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
this._host = parameter.Host;
|
||||
this._settings = parameter.V2raySettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_service = new V2rayService(_host, _settings);
|
||||
_service.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_service.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_service.Connect();
|
||||
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public ProjectProgress Progress
|
||||
{
|
||||
get => _service.Progress;
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get => _service.Progress.Logs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Command
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_service.Install);
|
||||
|
||||
public IMvxCommand UpdateSettingsCommand => new MvxCommand(_service.UpdateSettings);
|
||||
|
||||
public IMvxCommand UpdateV2rayCoreCommand => new MvxCommand(_service.UpdateV2rayCore);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_service.Uninstall);
|
||||
|
||||
public IMvxCommand UploadCertCommand => new MvxCommand(_service.UploadCert);
|
||||
|
||||
public IMvxCommand UploadWebCommand => new MvxCommand(_service.UploadWeb);
|
||||
|
||||
public IMvxCommand ApplyForCertCommand => new MvxCommand(_service.ApplyForCert);
|
||||
|
||||
#endregion
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".v2ray.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,11 +13,21 @@ namespace ProxySuper.Core.ViewModels
|
|||
Settings = parameter;
|
||||
}
|
||||
|
||||
public string Flow
|
||||
{
|
||||
get { return Settings.Flow; }
|
||||
}
|
||||
|
||||
public string UTLS
|
||||
{
|
||||
get { return Settings.UTLS; }
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_TCP_XTLS
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_TCP_XTLS);
|
||||
return Settings.Types.Contains(RayType.VLESS_TCP_XTLS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +35,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_TCP);
|
||||
return Settings.Types.Contains(RayType.VLESS_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +43,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_WS);
|
||||
return Settings.Types.Contains(RayType.VLESS_WS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +51,15 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_KCP);
|
||||
return Settings.Types.Contains(RayType.VLESS_KCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VLESS_QUIC
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VLESS_QUIC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +67,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_gRPC);
|
||||
return Settings.Types.Contains(RayType.VLESS_gRPC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +75,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VMESS_TCP);
|
||||
return Settings.Types.Contains(RayType.VMESS_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +83,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VMESS_WS);
|
||||
return Settings.Types.Contains(RayType.VMESS_WS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +91,15 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VMESS_KCP);
|
||||
return Settings.Types.Contains(RayType.VMESS_KCP);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Checked_VMESS_QUIC
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(RayType.VMESS_QUIC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +107,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.Trojan_TCP);
|
||||
return Settings.Types.Contains(RayType.Trojan_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +115,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.ShadowsocksAEAD);
|
||||
return Settings.Types.Contains(RayType.ShadowsocksAEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@ namespace ProxySuper.Core.ViewModels
|
|||
|
||||
public XraySettings Settings { get; set; }
|
||||
|
||||
public IMvxCommand SaveCommand => new MvxCommand(() => Save());
|
||||
public IMvxCommand SaveCommand => new MvxCommand(Save);
|
||||
|
||||
public IMvxCommand SaveAndInstallCommand => new MvxCommand(SaveAndInstall);
|
||||
|
||||
public IMvxNavigationService NavigationService { get; }
|
||||
|
||||
|
@ -47,12 +49,57 @@ namespace ProxySuper.Core.ViewModels
|
|||
XraySettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveAndInstall()
|
||||
{
|
||||
var record = new Record()
|
||||
{
|
||||
Id = Id,
|
||||
Host = Host,
|
||||
XraySettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<XrayInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class XrayEditorViewModel
|
||||
{
|
||||
public List<string> UTLSList { get => XraySettings.UTLSList; }
|
||||
|
||||
public List<string> KcpTypes => V2raySettings.DisguiseTypes;
|
||||
|
||||
public List<string> QuicTypes => V2raySettings.DisguiseTypes;
|
||||
|
||||
public List<string> QuicSecurities => new List<string>
|
||||
{
|
||||
"none",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305"
|
||||
};
|
||||
|
||||
public List<string> ShadowSocksMethods => new List<string>
|
||||
{
|
||||
"2022-blake3-aes-128-gcm",
|
||||
"2022-blake3-aes-256-gcm",
|
||||
"2022-blake3-chacha20-poly1305",
|
||||
"aes-256-gcm",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305",
|
||||
"none"
|
||||
};
|
||||
|
||||
public IMvxCommand RandomUuid => new MvxCommand(() => GetUuid());
|
||||
|
||||
public bool WithTLS
|
||||
{
|
||||
get => Settings.WithTLS;
|
||||
set
|
||||
{
|
||||
Settings.WithTLS = value;
|
||||
RaisePropertyChanged("Port");
|
||||
}
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
|
@ -64,6 +111,17 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public string UTLS
|
||||
{
|
||||
get => Settings.UTLS;
|
||||
set
|
||||
{
|
||||
Settings.UTLS = value;
|
||||
RaisePropertyChanged(nameof(UTLS));
|
||||
}
|
||||
}
|
||||
|
||||
public int VLESS_KCP_Port
|
||||
{
|
||||
get => Settings.VLESS_KCP_Port;
|
||||
|
@ -84,17 +142,6 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public int ShadowSocksPort
|
||||
{
|
||||
get => Settings.ShadowSocksPort;
|
||||
set
|
||||
{
|
||||
Settings.ShadowSocksPort = value;
|
||||
RaisePropertyChanged("ShadowSocksPort");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string UUID
|
||||
{
|
||||
get => Settings.UUID;
|
||||
|
@ -111,7 +158,8 @@ namespace ProxySuper.Core.ViewModels
|
|||
set
|
||||
{
|
||||
var input = value.Replace(',', ',');
|
||||
var arr = input.Split(',').ToList();
|
||||
var arr = input.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
arr.RemoveAll(x => x == this.UUID);
|
||||
Settings.MulitUUID = arr;
|
||||
RaisePropertyChanged("MultiUUID");
|
||||
}
|
||||
|
@ -137,6 +185,7 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
#region Trojan
|
||||
public string TrojanPassword
|
||||
{
|
||||
get => Settings.TrojanPassword;
|
||||
|
@ -147,36 +196,45 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.Trojan_TCP);
|
||||
return Settings.Types.Contains(RayType.Trojan_TCP);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
if (!Settings.Types.Contains(XrayType.Trojan_TCP))
|
||||
Settings.Types.Add(XrayType.Trojan_TCP);
|
||||
if (!Settings.Types.Contains(RayType.Trojan_TCP))
|
||||
Settings.Types.Add(RayType.Trojan_TCP);
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.Types.Remove(XrayType.Trojan_TCP);
|
||||
Settings.Types.Remove(RayType.Trojan_TCP);
|
||||
}
|
||||
RaisePropertyChanged("Checked_Trojan_TCP");
|
||||
}
|
||||
}
|
||||
public string Trojan_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.Trojan_TCP, Settings);
|
||||
get => ShareLink.Build(RayType.Trojan_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private List<string> _ssMethods = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305" };
|
||||
public List<string> ShadowSocksMethods => _ssMethods;
|
||||
#region ShadowSocks
|
||||
public int ShadowSocksPort
|
||||
{
|
||||
get => Settings.ShadowSocksPort;
|
||||
set
|
||||
{
|
||||
Settings.ShadowSocksPort = value;
|
||||
RaisePropertyChanged("ShadowSocksPort");
|
||||
}
|
||||
}
|
||||
public bool CheckedShadowSocks
|
||||
{
|
||||
|
||||
get => Settings.Types.Contains(XrayType.ShadowsocksAEAD);
|
||||
get => Settings.Types.Contains(RayType.ShadowsocksAEAD);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.ShadowsocksAEAD);
|
||||
CheckBoxChanged(value, RayType.ShadowsocksAEAD);
|
||||
RaisePropertyChanged("CheckedShadowSocks");
|
||||
}
|
||||
}
|
||||
|
@ -199,11 +257,11 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public string ShadowSocksShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.ShadowsocksAEAD, Settings);
|
||||
get => ShareLink.Build(RayType.ShadowsocksAEAD, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
private void CheckBoxChanged(bool value, XrayType type)
|
||||
private void CheckBoxChanged(bool value, RayType type)
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
|
@ -218,8 +276,6 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void GetUuid()
|
||||
{
|
||||
UUID = Guid.NewGuid().ToString();
|
||||
|
@ -233,13 +289,13 @@ namespace ProxySuper.Core.ViewModels
|
|||
/// </summary>
|
||||
public partial class XrayEditorViewModel
|
||||
{
|
||||
// vmess tcp
|
||||
#region VMESS TCP
|
||||
public bool Checked_VMESS_TCP
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VMESS_TCP);
|
||||
get => Settings.Types.Contains(RayType.VMESS_TCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VMESS_TCP);
|
||||
CheckBoxChanged(value, RayType.VMESS_TCP);
|
||||
RaisePropertyChanged("Checked_VMESS_TCP");
|
||||
}
|
||||
}
|
||||
|
@ -250,16 +306,17 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public string VMESS_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VMESS_TCP, Settings);
|
||||
get => ShareLink.Build(RayType.VMESS_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// vmess ws
|
||||
#region VMESS WS
|
||||
public bool Checked_VMESS_WS
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VMESS_WS);
|
||||
get => Settings.Types.Contains(RayType.VMESS_WS);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VMESS_WS);
|
||||
CheckBoxChanged(value, RayType.VMESS_WS);
|
||||
RaisePropertyChanged("Checked_VMESS_WS");
|
||||
}
|
||||
}
|
||||
|
@ -270,10 +327,11 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public string VMESS_WS_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VMESS_WS, Settings);
|
||||
get => ShareLink.Build(RayType.VMESS_WS, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// vmess kcp
|
||||
#region VMESS KCP
|
||||
public string VMESS_KCP_Seed
|
||||
{
|
||||
get => Settings.VMESS_KCP_Seed;
|
||||
|
@ -293,21 +351,71 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public bool Checked_VMESS_KCP
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VMESS_KCP);
|
||||
get => Settings.Types.Contains(RayType.VMESS_KCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VMESS_KCP);
|
||||
CheckBoxChanged(value, RayType.VMESS_KCP);
|
||||
RaisePropertyChanged("Checked_VMESS_KCP");
|
||||
}
|
||||
}
|
||||
public string VMESS_KCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VMESS_KCP, Settings);
|
||||
get => ShareLink.Build(RayType.VMESS_KCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VMESS QUIC
|
||||
public bool Checked_VMESS_QUIC
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VMESS_QUIC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VMESS_QUIC);
|
||||
RaisePropertyChanged(nameof(Checked_VMESS_QUIC));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Key
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Key;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Key = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Key));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Security
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Security;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Security = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Security));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_Type
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Type;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Type = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Type));
|
||||
}
|
||||
}
|
||||
public int VMESS_QUIC_Port
|
||||
{
|
||||
get => Settings.VMESS_QUIC_Port;
|
||||
set
|
||||
{
|
||||
Settings.VMESS_QUIC_Port = value;
|
||||
RaisePropertyChanged(nameof(VMESS_QUIC_Port));
|
||||
}
|
||||
}
|
||||
public string VMESS_QUIC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VMESS_QUIC, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private List<string> _kcpTypes = new List<string> { "none", "srtp", "utp", "wechat-video", "dtls", "wireguard", };
|
||||
public List<string> KcpTypes => _kcpTypes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -315,39 +423,51 @@ namespace ProxySuper.Core.ViewModels
|
|||
/// </summary>
|
||||
public partial class XrayEditorViewModel
|
||||
{
|
||||
#region VLESS XTLS
|
||||
|
||||
// vless xtls
|
||||
public bool Checked_VLESS_TCP_XTLS
|
||||
public List<string> FlowList { get => XraySettings.FlowList; }
|
||||
|
||||
public string Flow
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VLESS_TCP_XTLS);
|
||||
get => Settings.Flow;
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS);
|
||||
Settings.Flow = value;
|
||||
RaisePropertyChanged(nameof(Flow));
|
||||
}
|
||||
}
|
||||
public bool Checked_VLESS_TCP_XTLS
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VLESS_TCP_XTLS);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_TCP_XTLS);
|
||||
RaisePropertyChanged("Checked_VLESS_TCP_XTLS");
|
||||
}
|
||||
}
|
||||
public string VLESS_TCP_XTLS_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_TCP_XTLS, Settings);
|
||||
get => ShareLink.Build(RayType.VLESS_TCP_XTLS, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// vless tcp
|
||||
#region VLESS TCP
|
||||
public bool Checked_VLESS_TCP
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VLESS_TCP);
|
||||
get => Settings.Types.Contains(RayType.VLESS_TCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_TCP);
|
||||
CheckBoxChanged(value, RayType.VLESS_TCP);
|
||||
RaisePropertyChanged("Checked_VLESS_TCP");
|
||||
}
|
||||
}
|
||||
public string VLESS_TCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_TCP, Settings);
|
||||
get => ShareLink.Build(RayType.VLESS_TCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
// vless ws
|
||||
#region VLESS WS
|
||||
public string VLESS_WS_Path
|
||||
{
|
||||
get => Settings.VLESS_WS_Path;
|
||||
|
@ -357,24 +477,80 @@ namespace ProxySuper.Core.ViewModels
|
|||
{
|
||||
get
|
||||
{
|
||||
return Settings.Types.Contains(XrayType.VLESS_WS);
|
||||
return Settings.Types.Contains(RayType.VLESS_WS);
|
||||
}
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_WS);
|
||||
CheckBoxChanged(value, RayType.VLESS_WS);
|
||||
RaisePropertyChanged("Checked_VLESS_WS");
|
||||
}
|
||||
}
|
||||
public string VLESS_WS_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_WS, Settings);
|
||||
get => ShareLink.Build(RayType.VLESS_WS, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// vless kcp
|
||||
#region VLESS QUIC
|
||||
public string VLESS_QUIC_Key
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Key; set
|
||||
{
|
||||
Settings.VLESS_QUIC_Key = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Key));
|
||||
}
|
||||
}
|
||||
public bool Checked_VLESS_QUIC
|
||||
{
|
||||
get => Settings.Types.Contains(RayType.VLESS_QUIC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, RayType.VLESS_QUIC);
|
||||
RaisePropertyChanged(nameof(Checked_VLESS_QUIC));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_Security
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Security;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Security = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Security));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_Type
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Type;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Type = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Type));
|
||||
}
|
||||
}
|
||||
public int VLESS_QUIC_Port
|
||||
{
|
||||
get => Settings.VLESS_QUIC_Port;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_QUIC_Port = value;
|
||||
RaisePropertyChanged(nameof(VLESS_QUIC_Port));
|
||||
}
|
||||
}
|
||||
public string VLESS_QUIC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(RayType.VLESS_QUIC, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VLESS KCP
|
||||
public string VLESS_KCP_Seed
|
||||
{
|
||||
get => Settings.VLESS_KCP_Seed;
|
||||
set => Settings.VLESS_KCP_Seed = value;
|
||||
set
|
||||
{
|
||||
Settings.VLESS_KCP_Seed = value;
|
||||
RaisePropertyChanged(nameof(VLESS_KCP_Seed));
|
||||
}
|
||||
}
|
||||
public string VLESS_KCP_Type
|
||||
{
|
||||
|
@ -390,19 +566,20 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public bool Checked_VLESS_KCP
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VLESS_KCP);
|
||||
get => Settings.Types.Contains(RayType.VLESS_KCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_KCP);
|
||||
CheckBoxChanged(value, RayType.VLESS_KCP);
|
||||
RaisePropertyChanged("Checked_VLESS_KCP");
|
||||
}
|
||||
}
|
||||
public string VLESS_KCP_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_KCP, Settings);
|
||||
get => ShareLink.Build(RayType.VLESS_KCP, Settings);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// vless grpc
|
||||
#region VLESS gRPC
|
||||
public string VLESS_gRPC_ServiceName
|
||||
{
|
||||
get => Settings.VLESS_gRPC_ServiceName;
|
||||
|
@ -415,17 +592,18 @@ namespace ProxySuper.Core.ViewModels
|
|||
}
|
||||
public bool Checked_VLESS_gRPC
|
||||
{
|
||||
get => Settings.Types.Contains(XrayType.VLESS_gRPC);
|
||||
get => Settings.Types.Contains(RayType.VLESS_gRPC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_gRPC);
|
||||
CheckBoxChanged(value, RayType.VLESS_gRPC);
|
||||
RaisePropertyChanged("Checked_VLESS_gRPC");
|
||||
}
|
||||
}
|
||||
public string VLESS_gRPC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_gRPC, Settings);
|
||||
get => ShareLink.Build(RayType.VLESS_gRPC, Settings);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
|
|
88
ProxySuper.Core/ViewModels/XrayInstallViewModel.cs
Normal file
88
ProxySuper.Core/ViewModels/XrayInstallViewModel.cs
Normal file
|
@ -0,0 +1,88 @@
|
|||
using MvvmCross.Commands;
|
||||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class XrayInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
XraySettings _settings;
|
||||
|
||||
XrayService _xrayService;
|
||||
|
||||
public override void ViewDestroy(bool viewFinishing = true)
|
||||
{
|
||||
_xrayService.Disconnect();
|
||||
this.SaveInstallLog();
|
||||
base.ViewDestroy(viewFinishing);
|
||||
}
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
this._host = parameter.Host;
|
||||
this._settings = parameter.XraySettings;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_xrayService = new XrayService(_host, _settings);
|
||||
_xrayService.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_xrayService.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_xrayService.Connect();
|
||||
|
||||
return base.Initialize();
|
||||
}
|
||||
|
||||
public ProjectProgress Progress
|
||||
{
|
||||
get => _xrayService.Progress;
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get => _xrayService.Progress.Logs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Command
|
||||
|
||||
public IMvxCommand InstallCommand => new MvxCommand(_xrayService.Install);
|
||||
|
||||
public IMvxCommand UpdateSettingsCommand => new MvxCommand(_xrayService.UpdateSettings);
|
||||
|
||||
public IMvxCommand UpdateXrayCoreCommand => new MvxCommand(_xrayService.UpdateXrayCore);
|
||||
|
||||
public IMvxCommand UninstallCommand => new MvxCommand(_xrayService.Uninstall);
|
||||
|
||||
public IMvxCommand UploadCertCommand => new MvxCommand(_xrayService.UploadCert);
|
||||
|
||||
public IMvxCommand UploadWebCommand => new MvxCommand(_xrayService.UploadWeb);
|
||||
|
||||
public IMvxCommand ApplyForCertCommand => new MvxCommand(_xrayService.ApplyForCert);
|
||||
|
||||
#endregion
|
||||
|
||||
private void SaveInstallLog()
|
||||
{
|
||||
if (!Directory.Exists("Logs"))
|
||||
{
|
||||
Directory.CreateDirectory("Logs");
|
||||
}
|
||||
|
||||
var fileName = Path.Combine("Logs", DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".xary.txt");
|
||||
File.WriteAllText(fileName, Logs);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class XrayInstallerViewModel : MvxViewModel<Record>
|
||||
{
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public XraySettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
var record = Utils.DeepClone(parameter);
|
||||
Host = record.Host;
|
||||
Settings = record.XraySettings;
|
||||
}
|
||||
|
||||
|
||||
private bool _connected;
|
||||
public bool Connected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
set
|
||||
{
|
||||
_connected = value;
|
||||
RaisePropertyChanged("Connected");
|
||||
}
|
||||
}
|
||||
|
||||
public string CommandText { get; set; }
|
||||
}
|
||||
}
|
15
ProxySuper.Core/app.config
Normal file
15
ProxySuper.Core/app.config
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -1,7 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MvvmCross" version="7.1.2" targetFramework="net461" />
|
||||
<package id="QRCoder" version="1.4.1" targetFramework="net461" />
|
||||
<package id="SSH.NET" version="2020.0.1" targetFramework="net461" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.0" targetFramework="net472" />
|
||||
<package id="MvvmCross" version="8.0.2" targetFramework="net472" />
|
||||
<package id="QRCoder" version="1.4.3" targetFramework="net472" />
|
||||
<package id="SSH.NET" version="2023.0.0" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.Console" version="4.3.1" targetFramework="net461" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
</packages>
|
|
@ -1,6 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!--Languages-->
|
||||
<!--Language-->
|
||||
<ResourceDictionary Source="/Resources/Languages/zh_cn.xaml" />
|
||||
|
||||
<!--styles-->
|
||||
<!--style-->
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Padding" Value="5,2" />
|
||||
|
@ -24,7 +24,7 @@
|
|||
</Style>
|
||||
</ResourceDictionary>
|
||||
|
||||
<!--components styles-->
|
||||
<!--component style-->
|
||||
<ResourceDictionary Source="/Resources/Styles/DataGridStyle.xaml" />
|
||||
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace ProxySuper.WPF
|
|||
{
|
||||
protected override void RegisterSetup()
|
||||
{
|
||||
this.RegisterSetupType<MvxWpfSetup<Core.App>>();
|
||||
this.RegisterSetupType<Setup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
xmlns:local="clr-namespace:ProxySuper.WPF.Controls"
|
||||
xmlns:convert="clr-namespace:ProxySuper.Core.Converters;assembly=ProxySuper.Core"
|
||||
xmlns:host="clr-namespace:ProxySuper.Core.Models.Hosts;assembly=ProxySuper.Core"
|
||||
xmlns:ssh="clr-namespace:Renci.SshNet;assembly=Renci.SshNet"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
|
@ -16,7 +17,7 @@
|
|||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="300" />
|
||||
<RowDefinition Height="330" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
@ -35,6 +36,7 @@
|
|||
<RowDefinition Height="36" />
|
||||
<RowDefinition Height="36" />
|
||||
<RowDefinition Height="36" />
|
||||
<RowDefinition Height="36" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -104,7 +106,18 @@
|
|||
Converter={StaticResource SecretTypeConverter},
|
||||
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
|
||||
}"
|
||||
Content="{DynamicResource HostUploadSecretKey}" />
|
||||
Content="{DynamicResource HostUploadSecretKey}" />
|
||||
|
||||
<Label Content="{DynamicResource HostSertTypePrivateKeyPassPhrase}" Grid.Row="7" Grid.Column="0" />
|
||||
<TextBox Grid.Row="7" Grid.Column="1"
|
||||
Width="170"
|
||||
Text="{Binding Host.PrivateKeyPassPhrase}"
|
||||
IsEnabled="{
|
||||
Binding Host.SecretType,
|
||||
Converter={StaticResource SecretTypeConverter},
|
||||
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
|
||||
}"
|
||||
VerticalContentAlignment="Center" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
@ -129,21 +142,21 @@
|
|||
IsChecked="{
|
||||
Binding Host.Proxy.Type,
|
||||
Converter={StaticResource ProxyTypeConverter},
|
||||
ConverterParameter={x:Static host:LocalProxyType.None}
|
||||
ConverterParameter={x:Static ssh:ProxyTypes.None}
|
||||
}"/>
|
||||
<RadioButton Content="{DynamicResource ProxyTypeHttp}"
|
||||
Margin="5,0"
|
||||
IsChecked="{
|
||||
Binding Host.Proxy.Type,
|
||||
Converter={StaticResource ProxyTypeConverter},
|
||||
ConverterParameter={x:Static host:LocalProxyType.Http}
|
||||
ConverterParameter={x:Static ssh:ProxyTypes.Http}
|
||||
}"/>
|
||||
<RadioButton Content="{DynamicResource ProxyTypeSocks5}"
|
||||
Margin="5,0"
|
||||
IsChecked="{
|
||||
Binding Host.Proxy.Type,
|
||||
Converter={StaticResource ProxyTypeConverter},
|
||||
ConverterParameter={x:Static host:LocalProxyType.Socks5}
|
||||
ConverterParameter={x:Static ssh:ProxyTypes.Socks5}
|
||||
}"/>
|
||||
</StackPanel>
|
||||
|
||||
|
|
53
ProxySuper.WPF/Controls/ProgressControl.xaml
Normal file
53
ProxySuper.WPF/Controls/ProgressControl.xaml
Normal file
|
@ -0,0 +1,53 @@
|
|||
<UserControl x:Class="ProxySuper.WPF.Controls.ProgressControl"
|
||||
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:ProxySuper.WPF.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid VerticalAlignment="Top" Background="WhiteSmoke" Margin="0,0,0,20" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="200" />
|
||||
<RowDefinition Height="100" />
|
||||
<RowDefinition Height="1" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox x:Name="LogsTextBox"
|
||||
Grid.Row="0"
|
||||
Height="200"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Text="{Binding Path=Logs,Mode=OneWay}"
|
||||
VerticalContentAlignment="Top"
|
||||
Padding="10,0"
|
||||
FontSize="13"
|
||||
IsReadOnly="True"
|
||||
FontFamily="微软雅黑"
|
||||
Foreground="GreenYellow"
|
||||
Background="Black" />
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Grid.Row="1" Margin="10,10,0,0">
|
||||
<Label Content="{Binding Path=Progress.Step,Mode=OneWay}"
|
||||
FontSize="18"
|
||||
FontWeight="Bold" />
|
||||
|
||||
<Label Content="{Binding Path=Progress.Desc,Mode=OneWay}"
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Bottom"
|
||||
FontSize="12" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ProgressBar Maximum="100"
|
||||
Height="10"
|
||||
Width="200"
|
||||
Value="{Binding Path=Progress.Percentage,Mode=OneWay}" />
|
||||
|
||||
<Label Content="{Binding Path=Progress.Percentage}" />
|
||||
<Label Content="%" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<Border Grid.Row="3" Height="1" Background="Black" />
|
||||
</Grid>
|
||||
</UserControl>
|
37
ProxySuper.WPF/Controls/ProgressControl.xaml.cs
Normal file
37
ProxySuper.WPF/Controls/ProgressControl.xaml.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
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 ProxySuper.WPF.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// ProgressControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ProgressControl : UserControl
|
||||
{
|
||||
public ProgressControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
LogsTextBox.TextChanged += LogsTextBox_TextChanged;
|
||||
}
|
||||
|
||||
private void LogsTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
LogsTextBox.ScrollToEnd();
|
||||
}
|
||||
}
|
||||
}
|
470
ProxySuper.WPF/Controls/V2raySettingsControl.xaml
Normal file
470
ProxySuper.WPF/Controls/V2raySettingsControl.xaml
Normal file
|
@ -0,0 +1,470 @@
|
|||
<UserControl x:Class="ProxySuper.WPF.Controls.V2raySettingsControl"
|
||||
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:ProxySuper.WPF.Controls"
|
||||
xmlns:convert="clr-namespace:ProxySuper.Core.Converters;assembly=ProxySuper.Core"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<convert:VisibleConverter x:Key="VisibleConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<StackPanel Orientation="Vertical" Margin="10,0,20,20">
|
||||
<!--节点类型-->
|
||||
<GroupBox Padding="10" Header="{DynamicResource EditorProxyType}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--#region VLESS -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--TCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_TCP}">
|
||||
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--WebSocket-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_WS}">
|
||||
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_KCP}">
|
||||
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--quic-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_QUIC}">
|
||||
<Label Content="{DynamicResource VlessQuicDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--gRPC-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_gRPC}">
|
||||
<Label Content="{DynamicResource VlessRpcDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--WebSocket-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_WS}">
|
||||
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
|
||||
</CheckBox>
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_KCP}">
|
||||
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
|
||||
</CheckBox>
|
||||
|
||||
<!--quic-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="Blue"
|
||||
IsChecked="{Binding Path=Checked_VMESS_QUIC}">
|
||||
<Label Content="{DynamicResource VmessQuicDesc}" FontSize="12" Foreground="Blue" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region SS And Trojan -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--ss-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=CheckedShadowSocks}">
|
||||
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
|
||||
</CheckBox>
|
||||
|
||||
<!--Trojan-->
|
||||
<CheckBox Width="150"
|
||||
Foreground="CadetBlue"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_Trojan_TCP}">
|
||||
<Label Content="{DynamicResource TrojanDesc}" FontSize="13" Foreground="CadetBlue" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!--************************** 参数 **************************-->
|
||||
|
||||
<!--参数设置-->
|
||||
<GroupBox Padding="10" Margin="0,10,0,0" Header="{DynamicResource EditorProxyParams}">
|
||||
<StackPanel>
|
||||
<!--#region Common Settings -->
|
||||
<!--Domain-->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=Domain}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--UUID-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayUUID}" Width="120" />
|
||||
<TextBox Text="{Binding Path=UUID}" Width="200" />
|
||||
<Button Margin="5,0,0,0"
|
||||
Padding="12,3"
|
||||
Command="{Binding Path=RandomUuid}"
|
||||
Content="{DynamicResource Random}" />
|
||||
</StackPanel>
|
||||
|
||||
<!--v2ray prot-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource V2rayPort}" Width="120" />
|
||||
<TextBox Text="{Binding Path=Port}" Width="120" />
|
||||
<Label Content="{DynamicResource XrayPortDefault}" Foreground="Red" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--more params-->
|
||||
<Expander ExpandDirection="Down" Margin="0,10,0,0">
|
||||
<Expander.Header>
|
||||
<TextBlock Text="{DynamicResource MoreParameters}" FontWeight="Bold" />
|
||||
</Expander.Header>
|
||||
|
||||
<Expander.Content>
|
||||
<StackPanel>
|
||||
<!--#region Cert Settings -->
|
||||
<!--证书-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayWithTLS}" Width="120" />
|
||||
<CheckBox IsChecked="{Binding Path=WithTLS}"
|
||||
Content="{DynamicResource XrayWithTLSDesc}"
|
||||
VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--Mask Domain-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=MaskDomain}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--#region VLESS WebSocket Settings -->
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_WS_Path}" Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS KCP Settings -->
|
||||
<!--seed-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Seed}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
|
||||
<ComboBox Width="200"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VLESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS Quic Settings -->
|
||||
<!--quic port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicPort}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_QUIC_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic key-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicKey}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_QUIC_Key}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic security-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicSecurity}" Foreground="LimeGreen" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding QuicSecurities}"
|
||||
SelectedValue="{Binding VLESS_QUIC_Security}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--quic type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicType}" Foreground="LimeGreen" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=QuicTypes}"
|
||||
SelectedValue="{Binding VLESS_QUIC_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS gRPC Settings -->
|
||||
<!--gRPC Port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCName}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_ServiceName}" Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS WebSocket Settings -->
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_WS_Path}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS KCP Settings -->
|
||||
<!--seed-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Seed}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="200"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VMESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS Quic Settings -->
|
||||
<!--quic port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicPort}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_QUIC_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic key-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicKey}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_QUIC_Key}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic security-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicSecurity}" Foreground="Blue" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding QuicSecurities}"
|
||||
SelectedValue="{Binding VMESS_QUIC_Security}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--quic type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=QuicTypes}"
|
||||
SelectedValue="{Binding VMESS_QUIC_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region ShadowSocks Settings -->
|
||||
<!--ss密码-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPassword}" Width="200"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss加密方式-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
|
||||
<ComboBox Width="200"
|
||||
ItemsSource="{Binding ShadowSocksMethods}"
|
||||
SelectedValue="{Binding ShadowSocksMethod}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss端口-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPort}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPort}" Width="200"/>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Trojan Settings -->
|
||||
<!--Trojan密码-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_Trojan_TCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
|
||||
<TextBox Text="{Binding Path=TrojanPassword}" Width="200" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Multiple Users Settings -->
|
||||
<!--多用户-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource MultiUser}" Width="120" />
|
||||
|
||||
<TextBox Text="{Binding Path=MultiUUID}"
|
||||
Height="60"
|
||||
TextWrapping="Wrap"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Margin="120,3,0,0" Text="{DynamicResource MultiUserHelp}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
</StackPanel>
|
||||
</Expander.Content>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
28
ProxySuper.WPF/Controls/V2raySettingsControl.xaml.cs
Normal file
28
ProxySuper.WPF/Controls/V2raySettingsControl.xaml.cs
Normal 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 ProxySuper.WPF.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// V2raySettingsControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class V2raySettingsControl : UserControl
|
||||
{
|
||||
public V2raySettingsControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
61
ProxySuper.WPF/Controls/VLESS_QUIC_Control.xaml
Normal file
61
ProxySuper.WPF/Controls/VLESS_QUIC_Control.xaml
Normal file
|
@ -0,0 +1,61 @@
|
|||
<UserControl x:Class="ProxySuper.WPF.Controls.VLESS_QUIC_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:ProxySuper.WPF.Controls"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="地址(address)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="端口(port)" Width="140" />
|
||||
<TextBox Text="{Binding Path=Settings.VLESS_QUIC_Port,Mode=OneTime}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="用户ID(id)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="加密(security)" Width="140" />
|
||||
<TextBox Text="none" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="传输协议(network)" Width="140" />
|
||||
<TextBox Text="quic" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装类型(type)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VLESS_QUIC_Type}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VLESS_QUIC_Security}" IsReadOnly="True" Width="300" />
|
||||
<Label Content="QUIC加密方式" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="路径(path)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VLESS_QUIC_Key}" IsReadOnly="True" Width="300" />
|
||||
<Label Content="QUIC密钥" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="传输安全(tls)" Width="140" />
|
||||
<TextBox Text="" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="分享链接(ShareLink)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VLESS_QUIC_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
28
ProxySuper.WPF/Controls/VLESS_QUIC_Control.xaml.cs
Normal file
28
ProxySuper.WPF/Controls/VLESS_QUIC_Control.xaml.cs
Normal 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 ProxySuper.WPF.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// VLESS_QUIC_Control.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class VLESS_QUIC_Control : UserControl
|
||||
{
|
||||
public VLESS_QUIC_Control()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,7 +42,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
@ -23,7 +23,12 @@
|
|||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="流控(flow)" Width="140" />
|
||||
<TextBox Text="xtls-rprx-direct" IsReadOnly="True" Width="300" />
|
||||
<TextBox Text="{Binding Settings.Flow}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="uTLS" Width="140" />
|
||||
<TextBox Text="{Binding Settings.UTLS}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
|
@ -42,7 +47,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
@ -53,7 +58,7 @@
|
|||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="传输安全(tls)" Width="140" />
|
||||
<TextBox Text="xtls" IsReadOnly="True" Width="300" />
|
||||
<TextBox Text="tls" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
62
ProxySuper.WPF/Controls/VMESS_QUIC_Control.xaml
Normal file
62
ProxySuper.WPF/Controls/VMESS_QUIC_Control.xaml
Normal file
|
@ -0,0 +1,62 @@
|
|||
<UserControl x:Class="ProxySuper.WPF.Controls.VMESS_QUIC_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:ProxySuper.WPF.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="地址(address)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="端口(port)" Width="140" />
|
||||
<TextBox Text="{Binding Path=Settings.VMESS_QUIC_Port,Mode=OneTime}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="用户ID(id)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="加密(security)" Width="140" />
|
||||
<TextBox Text="none" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="传输协议(network)" Width="140" />
|
||||
<TextBox Text="quic" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装类型(type)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VMESS_QUIC_Type}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VMESS_QUIC_Security}" IsReadOnly="True" Width="300" />
|
||||
<Label Content="QUIC加密方式" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="路径(path)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VMESS_QUIC_Key}" IsReadOnly="True" Width="300" />
|
||||
<Label Content="QUIC密钥" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="传输安全(tls)" Width="140" />
|
||||
<TextBox Text="" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="分享链接(ShareLink)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.VMESS_QUIC_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
28
ProxySuper.WPF/Controls/VMESS_QUIC_Control.xaml.cs
Normal file
28
ProxySuper.WPF/Controls/VMESS_QUIC_Control.xaml.cs
Normal 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 ProxySuper.WPF.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// VMESS_QUIC_Control.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class VMESS_QUIC_Control : UserControl
|
||||
{
|
||||
public VMESS_QUIC_Control()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
||||
<Label Content="伪装域名(host)" Width="140" />
|
||||
<Label Content="域名(host)" Width="140" />
|
||||
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="300" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
@ -11,320 +11,491 @@
|
|||
<convert:VisibleConverter x:Key="VisibleConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Width="220">
|
||||
<!--XTLS-->
|
||||
<CheckBox Margin="0,10,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_TCP_XTLS}">
|
||||
<Label Content="{DynamicResource VlessXtlsDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Vertical" Margin="10,0,20,20">
|
||||
<!--节点类型-->
|
||||
<GroupBox Padding="10" Header="{DynamicResource EditorProxyType}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--#region VLESS -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--XTLS-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_TCP_XTLS}">
|
||||
<Label Content="{DynamicResource VlessXtlsDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--TCP-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_TCP}">
|
||||
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
<!--TCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_TCP}">
|
||||
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--WebSocket-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_WS}">
|
||||
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
<!--WebSocket-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VLESS_WS}">
|
||||
<Label Content="{DynamicResource VlessWsDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
<!--mKCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_KCP}">
|
||||
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--gRPC-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_gRPC}">
|
||||
<Label Content="VLESS gRPC
基于http2,多路复用。" FontSize="13" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
<!--quic-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_QUIC}">
|
||||
<Label Content="{DynamicResource VlessQuicDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
|
||||
<!--TCP-->
|
||||
<!--<CheckBox Content="VMESS over TCP with TLS
不推荐"
|
||||
Margin="0,15,0,0"
|
||||
FontSize="13"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Checked_VMESS_TCP}" />-->
|
||||
<!--gRPC-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="LimeGreen"
|
||||
IsChecked="{Binding Path=Checked_VLESS_gRPC}">
|
||||
<Label Content="{DynamicResource VlessRpcDesc}" FontSize="12" Foreground="LimeGreen" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--WebSocket-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_WS}">
|
||||
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
|
||||
</CheckBox>
|
||||
<!--#region VMESS -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--WebSocket-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_WS}">
|
||||
<Label Content="{DynamicResource VmessWsDesc}" FontSize="12" Foreground="Blue" />
|
||||
</CheckBox>
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_KCP}">
|
||||
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
|
||||
</CheckBox>
|
||||
<!--mKCP-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_VMESS_KCP}">
|
||||
<Label Foreground="Blue" FontSize="12" Content="{DynamicResource VmessKcpDesc}" />
|
||||
</CheckBox>
|
||||
|
||||
<!--ss-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
<!--quic-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="Blue"
|
||||
IsChecked="{Binding Path=Checked_VMESS_QUIC}">
|
||||
<Label Content="{DynamicResource VmessQuicDesc}" FontSize="12" Foreground="Blue" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region SS And Trojan -->
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<!--ss-->
|
||||
<CheckBox Width="150"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=CheckedShadowSocks}">
|
||||
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
|
||||
</CheckBox>
|
||||
<Label Content="{DynamicResource SSDesc}" FontSize="12" Foreground="Fuchsia" />
|
||||
</CheckBox>
|
||||
|
||||
<!--Trojan-->
|
||||
<CheckBox Margin="0,15,0,0"
|
||||
<!--Trojan-->
|
||||
<CheckBox Width="150"
|
||||
Foreground="CadetBlue"
|
||||
VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Path=Checked_Trojan_TCP}">
|
||||
<Label Content="{DynamicResource TrojanDesc}" FontSize="13" Foreground="CadetBlue" />
|
||||
</CheckBox>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<!--************************** 参数 **************************-->
|
||||
|
||||
<StackPanel>
|
||||
|
||||
<!--Domain-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=Domain}" Width="200" />
|
||||
<Label Content="{DynamicResource TrojanDesc}" FontSize="12" Foreground="CadetBlue" />
|
||||
</CheckBox>
|
||||
</WrapPanel>
|
||||
<!--#endregion-->
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!--Mask Domain-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=MaskDomain}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--UUID-->
|
||||
<StackPanel Margin="30,10,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayUUID}" Width="120" />
|
||||
|
||||
<TextBox Text="{Binding Path=UUID}"
|
||||
Width="200" />
|
||||
|
||||
<Button Margin="5,0,0,0"
|
||||
Padding="12,3"
|
||||
Command="{Binding Path=RandomUuid}"
|
||||
Content="{DynamicResource Random}" />
|
||||
</StackPanel>
|
||||
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_WS_Path}"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--seed-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Seed}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}" Orientation="Horizontal">
|
||||
|
||||
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
|
||||
<ComboBox Width="200"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VLESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--gRPC Port-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCName}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_ServiceName}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Tcp Path
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_TCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="VMESS WS路径" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_TCP_Path}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="200" />
|
||||
</StackPanel>-->
|
||||
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_WS_Path}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--seed-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Seed}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="200"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VMESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Port}" Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--ss密码-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPassword}"
|
||||
Width="200"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss加密方式-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
|
||||
<ComboBox Width="200"
|
||||
ItemsSource="{Binding ShadowSocksMethods}"
|
||||
SelectedValue="{Binding ShadowSocksMethod}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss端口-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPort}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPort}" Width="200"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--Trojan密码-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_Trojan_TCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
|
||||
<TextBox Text="{Binding Path=TrojanPassword}"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!--xray prot-->
|
||||
<StackPanel Margin="30,15,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayPort}" Foreground="Gray" Width="120" />
|
||||
<TextBox Text="{Binding Path=Port}" Width="120" />
|
||||
<Label Content="{DynamicResource XrayPortDefault}" Foreground="Red" />
|
||||
</StackPanel>
|
||||
|
||||
<!--多用户-->
|
||||
<StackPanel Margin="30,10,0,0"
|
||||
Orientation="Vertical">
|
||||
<!--参数设置-->
|
||||
<GroupBox Padding="10" Margin="0,10,0,0" Header="{DynamicResource EditorProxyParams}">
|
||||
<StackPanel>
|
||||
<!--#region Base Settings -->
|
||||
<!--Domain-->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource MultiUser}" Width="120" />
|
||||
<Label Content="{DynamicResource XrayDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=Domain}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBox Text="{Binding Path=MultiUUID}"
|
||||
Height="60"
|
||||
TextWrapping="Wrap"
|
||||
Width="200" />
|
||||
<!--UUID-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayUUID}" Width="120" />
|
||||
|
||||
<TextBox Text="{Binding Path=UUID}"
|
||||
Width="260" />
|
||||
|
||||
<Button Margin="5,0,0,0"
|
||||
Padding="12,3"
|
||||
Command="{Binding Path=RandomUuid}"
|
||||
Content="{DynamicResource Random}" />
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Margin="120,3,0,0" Text="{DynamicResource MultiUserHelp}" />
|
||||
|
||||
<!--xray prot-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayPort}" Width="120" />
|
||||
<TextBox Text="{Binding Path=Port}" Width="120" />
|
||||
<Label Content="{DynamicResource XrayPortDefault}" Foreground="Red" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--more params-->
|
||||
<Expander ExpandDirection="Down" Margin="0,10,0,0">
|
||||
<Expander.Header>
|
||||
<TextBlock Text="{DynamicResource MoreParameters}" FontWeight="Bold" />
|
||||
</Expander.Header>
|
||||
|
||||
<Expander.Content>
|
||||
<StackPanel>
|
||||
<!--#region Common Settings -->
|
||||
<!--xray utls-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource UTLS}" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=UTLSList}"
|
||||
SelectedValue="{Binding UTLS,Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Flow-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_TCP_XTLS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource Flow}" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=FlowList}"
|
||||
SelectedValue="{Binding Flow,Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Cert-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayWithTLS}" Width="120" />
|
||||
<CheckBox IsChecked="{Binding Path=WithTLS}"
|
||||
Content="{DynamicResource XrayWithTLSDesc}"
|
||||
VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Mask Domain-->
|
||||
<StackPanel Margin="0,15,0,0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
|
||||
<TextBox Text="{Binding Path=MaskDomain}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS WS Settings -->
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_WS_Path}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS KCP SETTINGS -->
|
||||
<!--seed-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Seed}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VLESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_KCP_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS Quic Settings -->
|
||||
<!--quic port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicPort}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_QUIC_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic key-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicKey}" Foreground="LimeGreen" Width="120" />
|
||||
<TextBox Text="{Binding Path=VLESS_QUIC_Key}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic security-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicSecurity}" Foreground="LimeGreen" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding QuicSecurities}"
|
||||
SelectedValue="{Binding VLESS_QUIC_Security}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--quic type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessQuicType}" Foreground="LimeGreen" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=QuicTypes}"
|
||||
SelectedValue="{Binding VLESS_QUIC_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VLESS GRPC SETTINGS -->
|
||||
<!--gRPC Port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCPort}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VlessRPCName}" Width="120" Foreground="LimeGreen" />
|
||||
<TextBox Text="{Binding Path=VLESS_gRPC_ServiceName}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS WS SETTINGS -->
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_WS_Path}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS KCP SETTINGS -->
|
||||
<!--seed-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Seed}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=KcpTypes}"
|
||||
SelectedValue="{Binding VMESS_KCP_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_KCP_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region VMESS Quic Settings -->
|
||||
<!--quic port-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicPort}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_QUIC_Port}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic key-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicKey}" Foreground="Blue" Width="120" />
|
||||
<TextBox Text="{Binding Path=VMESS_QUIC_Key}" Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--quic security-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicSecurity}" Foreground="Blue" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding QuicSecurities}"
|
||||
SelectedValue="{Binding VMESS_QUIC_Security}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--quic type-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_VMESS_QUIC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource VmessQuicType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
|
||||
<ComboBox Width="260"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Path=QuicTypes}"
|
||||
SelectedValue="{Binding VMESS_QUIC_Type,Mode=TwoWay}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region ShadowSocks Settings -->
|
||||
<!--ss密码-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPassword}" Width="260"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss加密方式-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
|
||||
<ComboBox Width="260"
|
||||
ItemsSource="{Binding ShadowSocksMethods}"
|
||||
SelectedValue="{Binding ShadowSocksMethod}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--ss端口-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource SSPort}" Foreground="Fuchsia" Width="120" />
|
||||
<TextBox Text="{Binding Path=ShadowSocksPort}" Width="260"/>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Trojan Settings -->
|
||||
<!--Trojan密码-->
|
||||
<StackPanel Margin="0,15,0,0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Checked_Trojan_TCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
|
||||
<TextBox Text="{Binding Path=TrojanPassword}" Width="260" />
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Multiple Users Settings -->
|
||||
<!--多用户-->
|
||||
<StackPanel Margin="0,10,0,0" Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource MultiUser}" Width="120" />
|
||||
|
||||
<TextBox Text="{Binding Path=MultiUUID}"
|
||||
Height="60"
|
||||
TextWrapping="Wrap"
|
||||
Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Margin="120,3,0,0" Text="{DynamicResource MultiUserHelp}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--#endregion-->
|
||||
</StackPanel>
|
||||
</Expander.Content>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Icon="/Resources/ProxySU.ico"
|
||||
Title="ProxySU" Height="600" Width="1000">
|
||||
Title="ProxySU v4.1.10" Height="600" Width="1000">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
|
|
|
@ -49,5 +49,5 @@ using System.Windows;
|
|||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("4.0.4.0")]
|
||||
[assembly: AssemblyFileVersion("4.0.4.0")]
|
||||
[assembly: AssemblyVersion("4.1.10.0")]
|
||||
[assembly: AssemblyFileVersion("4.1.10.0")]
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
@ -28,20 +28,29 @@
|
|||
<PropertyGroup>
|
||||
<ApplicationIcon>ProxySU.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>ProxySuper.WPF.App</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MvvmCross, Version=7.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.7.1.2\lib\net461\MvvmCross.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MvvmCross.Platforms.Wpf, Version=7.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.Platforms.Wpf.7.1.2\lib\net461\MvvmCross.Platforms.Wpf.dll</HintPath>
|
||||
<Reference Include="MvvmCross, Version=8.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.8.0.2\lib\net461\MvvmCross.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 Include="MvvmCross.Platforms.Wpf, Version=8.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmCross.Platforms.Wpf.8.0.2\lib\net461\MvvmCross.Platforms.Wpf.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 Include="QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.4.3\lib\net40\QRCoder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Renci.SshNet, Version=2023.0.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SSH.NET.2023.0.0\lib\net462\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Console, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
|
@ -49,6 +58,16 @@
|
|||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -75,18 +94,27 @@
|
|||
<Compile Include="Controls\HostControl.xaml.cs">
|
||||
<DependentUpon>HostControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ProgressControl.xaml.cs">
|
||||
<DependentUpon>ProgressControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ShadowSocksControl.xaml.cs">
|
||||
<DependentUpon>ShadowSocksControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\Trojan_TCP_Control.xaml.cs">
|
||||
<DependentUpon>Trojan_TCP_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\V2raySettingsControl.xaml.cs">
|
||||
<DependentUpon>V2raySettingsControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VLESS_gRPC_Control.xaml.cs">
|
||||
<DependentUpon>VLESS_gRPC_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VLESS_KCP_Control.xaml.cs">
|
||||
<DependentUpon>VLESS_KCP_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VLESS_QUIC_Control.xaml.cs">
|
||||
<DependentUpon>VLESS_QUIC_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VLESS_TCP_TLS_Control.xaml.cs">
|
||||
<DependentUpon>VLESS_TCP_TLS_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -99,6 +127,9 @@
|
|||
<Compile Include="Controls\VMESS_KCP_Control.xaml.cs">
|
||||
<DependentUpon>VMESS_KCP_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VMESS_QUIC_Control.xaml.cs">
|
||||
<DependentUpon>VMESS_QUIC_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\VMESS_TCP_TLS_Control.xaml.cs">
|
||||
<DependentUpon>VMESS_TCP_TLS_Control.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -111,14 +142,15 @@
|
|||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\BrookConfigView.xaml.cs">
|
||||
<Compile Include="Setup.cs" />
|
||||
<Compile Include="Views\Brook\BrookConfigView.xaml.cs">
|
||||
<DependentUpon>BrookConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\BrookEditorView.xaml.cs">
|
||||
<Compile Include="Views\Brook\BrookEditorView.xaml.cs">
|
||||
<DependentUpon>BrookEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\BrookInstallerView.xaml.cs">
|
||||
<DependentUpon>BrookInstallerView.xaml</DependentUpon>
|
||||
<Compile Include="Views\Brook\BrookInstallView.xaml.cs">
|
||||
<DependentUpon>BrookInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\EnableRootView.xaml.cs">
|
||||
<DependentUpon>EnableRootView.xaml</DependentUpon>
|
||||
|
@ -126,40 +158,71 @@
|
|||
<Compile Include="Views\HomeView.xaml.cs">
|
||||
<DependentUpon>HomeView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxyConfigView.xaml.cs">
|
||||
<Compile Include="Views\Hysteria\HysteriaConfigView.xaml.cs">
|
||||
<DependentUpon>HysteriaConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Hysteria\HysteriaEditorView.xaml.cs">
|
||||
<DependentUpon>HysteriaEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Hysteria\HysteriaInstallView.xaml.cs">
|
||||
<DependentUpon>HysteriaInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MTProxyGo\MTProxyGoConfigView.xaml.cs">
|
||||
<DependentUpon>MTProxyGoConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MTProxyGo\MTProxyGoEditorView.xaml.cs">
|
||||
<DependentUpon>MTProxyGoEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs">
|
||||
<DependentUpon>MTProxyGoInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyConfigView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxyEditorView.xaml.cs">
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyEditorView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxyInstallerView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyInstallerView.xaml</DependentUpon>
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyInstallView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ShareLinkView.xaml.cs">
|
||||
<DependentUpon>ShareLinkView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\TrojanGoConfigView.xaml.cs">
|
||||
<Compile Include="Views\TrojanGo\TrojanGoConfigView.xaml.cs">
|
||||
<DependentUpon>TrojanGoConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\TrojanGoEditorView.xaml.cs">
|
||||
<Compile Include="Views\TrojanGo\TrojanGoEditorView.xaml.cs">
|
||||
<DependentUpon>TrojanGoEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\TrojanGoInstallerView.xaml.cs">
|
||||
<DependentUpon>TrojanGoInstallerView.xaml</DependentUpon>
|
||||
<Compile Include="Views\TrojanGo\TrojanGoInstallView.xaml.cs">
|
||||
<DependentUpon>TrojanGoInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\XrayEditorView.xaml.cs">
|
||||
<Compile Include="Views\V2ray\V2rayConfigView.xaml.cs">
|
||||
<DependentUpon>V2rayConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\V2ray\V2rayEditorView.xaml.cs">
|
||||
<DependentUpon>V2rayEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\V2ray\V2rayInstallView.xaml.cs">
|
||||
<DependentUpon>V2rayInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Xray\XrayEditorView.xaml.cs">
|
||||
<DependentUpon>XrayEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\XrayConfigView.xaml.cs">
|
||||
<Compile Include="Views\Xray\XrayConfigView.xaml.cs">
|
||||
<DependentUpon>XrayConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\XrayInstallerView.xaml.cs">
|
||||
<DependentUpon>XrayInstallerView.xaml</DependentUpon>
|
||||
<Compile Include="Views\Xray\XrayInstallView.xaml.cs">
|
||||
<DependentUpon>XrayInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="Controls\HostControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\ProgressControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\ShadowSocksControl.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -168,6 +231,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls\V2raySettingsControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\VLESS_gRPC_Control.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -176,6 +243,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls\VLESS_QUIC_Control.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls\VLESS_TCP_TLS_Control.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -192,6 +263,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls\VMESS_QUIC_Control.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls\VMESS_TCP_TLS_Control.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -213,15 +288,15 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Views\BrookConfigView.xaml">
|
||||
<Page Include="Views\Brook\BrookConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\BrookEditorView.xaml">
|
||||
<Page Include="Views\Brook\BrookEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\BrookInstallerView.xaml">
|
||||
<Page Include="Views\Brook\BrookInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -242,6 +317,11 @@
|
|||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Resources\Languages\fa_IR.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Resources\Languages\zh_cn.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -252,15 +332,39 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxyConfigView.xaml">
|
||||
<Page Include="Views\Hysteria\HysteriaConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxyEditorView.xaml">
|
||||
<Page Include="Views\Hysteria\HysteriaEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxyInstallerView.xaml">
|
||||
<Page Include="Views\Hysteria\HysteriaInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\MTProxyGo\MTProxyGoConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\MTProxyGo\MTProxyGoEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\MTProxyGo\MTProxyGoInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -268,27 +372,39 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\TrojanGoConfigView.xaml">
|
||||
<Page Include="Views\TrojanGo\TrojanGoConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\TrojanGoEditorView.xaml">
|
||||
<Page Include="Views\TrojanGo\TrojanGoEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\TrojanGoInstallerView.xaml">
|
||||
<Page Include="Views\TrojanGo\TrojanGoInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\XrayEditorView.xaml">
|
||||
<Page Include="Views\V2ray\V2rayConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\XrayConfigView.xaml">
|
||||
<Page Include="Views\V2ray\V2rayEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\XrayInstallerView.xaml">
|
||||
<Page Include="Views\V2ray\V2rayInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Xray\XrayEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Xray\XrayConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Xray\XrayInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -316,6 +432,9 @@
|
|||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Templates\Hysteria\config.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\NaiveProxy\naive_server.caddyfile">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -325,6 +444,120 @@
|
|||
<None Include="Templates\trojan-go\trojan-go.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\base.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\caddy\base.caddyfile">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\00_log\00_log.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\01_api\01_api.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\02_dns\02_dns.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\03_routing\03_routing.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\04_policy\04_policy.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\05_inbounds\05_inbounds.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\06_outbounds\06_outbounds.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\06_outbounds\VLESS_HTTP2_TLS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\06_outbounds\VLESS_TCP_TLS_WS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\07_transport\07_transport.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\08_stats\08_stats.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\client\09_reverse\09_reverse.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\00_log\00_log.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\01_api\01_api.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\02_dns\02_dns.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\03_routing\03_routing.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\04_policy\04_policy.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\05_inbounds.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\Shadowsocks-AEAD.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\Trojan_TCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\Trojan_WS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_gRPC.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_HTTP2.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_KCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_QUIC.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_TCP_TLS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VLESS_WS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VMESS_HTTP2.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VMESS_KCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VMESS_QUIC.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VMESS_TCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\05_inbounds\VMESS_WS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\06_outbounds\06_outbounds.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\07_transport\07_transport.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\08_stats\08_stats.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\v2ray\server\09_reverse\09_reverse.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\base.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -403,6 +636,9 @@
|
|||
<None Include="Templates\xray\server\05_inbounds\VLESS_KCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\server\05_inbounds\VLESS_QUIC.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\server\05_inbounds\VLESS_TCP_XTLS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -415,6 +651,9 @@
|
|||
<None Include="Templates\xray\server\05_inbounds\VMESS_KCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\server\05_inbounds\VMESS_QUIC.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\server\05_inbounds\VMESS_TCP.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
|
||||
<!--common-->
|
||||
<sys:String x:Key="Random">Random</sys:String>
|
||||
<sys:String x:Key="Save">Save</sys:String>
|
||||
<sys:String x:Key="SaveAndInstall">Save And Install</sys:String>
|
||||
<sys:String x:Key="SaveAs">SaveAs</sys:String>
|
||||
<sys:String x:Key="Install">Install</sys:String>
|
||||
<sys:String x:Key="Settings">Settings</sys:String>
|
||||
|
@ -21,6 +22,7 @@
|
|||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageCn">中文</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageTw">正體</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageFr">فارسی</sys:String>
|
||||
|
||||
<sys:String x:Key="MainMenuHelper">Helper</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperGithub">Github</sys:String>
|
||||
|
@ -37,6 +39,8 @@
|
|||
<sys:String x:Key="MainDataGridColumnActionEdit">Edit</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionViewConfig">ViewConfig</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionDelete">Delete</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortUp">Up</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortDone">Down</sys:String>
|
||||
|
||||
|
||||
<!--Editor Window-->
|
||||
|
@ -50,6 +54,7 @@
|
|||
<sys:String x:Key="HostUploadSecretKey">UploadKey</sys:String>
|
||||
<sys:String x:Key="HostSertTypePassword">Password</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKey">PrivateKey</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">PKPassword</sys:String>
|
||||
|
||||
|
||||
<sys:String x:Key="ProxyGroupName">Proxy</sys:String>
|
||||
|
@ -61,41 +66,61 @@
|
|||
<sys:String x:Key="ProxyTypeNone">None</sys:String>
|
||||
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
|
||||
<sys:String x:Key="ProxyTypeSocks5">Socks5</sys:String>
|
||||
|
||||
|
||||
<!--editor-->
|
||||
<sys:String x:Key="EditorProxyType" xml:space="preserve">Proxy Type</sys:String>
|
||||
<sys:String x:Key="EditorProxyParams" xml:space="preserve">Params</sys:String>
|
||||
|
||||
<!--Xray-->
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS over TCP With XTLS
Preferred</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS
XTLS is Preferred</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS
Support CDN</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP
low delay,without Domain</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS
Support CDN</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP
low delay,without Domian</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks
Support UDP,without Domain</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS
Trojan</sys:String>
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS XTLS</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS TCP</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS WS</sys:String>
|
||||
<sys:String x:Key="VlessRpcDesc" xml:space="preserve">VLESS gRPC</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP</sys:String>
|
||||
<sys:String x:Key="VlessQuicDesc" xml:space="preserve">VLESS QUIC</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS WS</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP</sys:String>
|
||||
<sys:String x:Key="VmessQuicDesc" xml:space="preserve">VMESS QUIC</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan</sys:String>
|
||||
|
||||
<sys:String x:Key="XrayDomain">Domain/IP</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">GuiseHost</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">Redir Url</sys:String>
|
||||
<sys:String x:Key="XrayWithTLS">With TLS</sys:String>
|
||||
<sys:String x:Key="XrayWithTLSDesc">Unchecked means upload your own TLS.</sys:String>
|
||||
<sys:String x:Key="XrayUUID">UUID</sys:String>
|
||||
<sys:String x:Key="Flow">Flow</sys:String>
|
||||
<sys:String x:Key="UTLS">uTLS</sys:String>
|
||||
<sys:String x:Key="MultiUser">Multi User</sys:String>
|
||||
<sys:String x:Key="MultiUserHelp">Multi Id split with ","</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="VlessQuicPort">VLESS QUIC Port</sys:String>
|
||||
<sys:String x:Key="VlessQuicKey">VLESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VlessQuicSecurity">VLESS QUIC Security</sys:String>
|
||||
<sys:String x:Key="VlessQuicType">VLESS QUIC Type</sys:String>
|
||||
<sys:String x:Key="VlessRPCName">gRPC Service Name</sys:String>
|
||||
<sys:String x:Key="VlessRPCPort">gRPC 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="VmessQuicKey">VMESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VmessQuicPort">VMESS QUIC Port</sys:String>
|
||||
<sys:String x:Key="VmessQuicSecurity">VMESS QUIC Security</sys:String>
|
||||
<sys:String x:Key="VmessQuicType">VMESS QUIC Type</sys:String>
|
||||
<sys:String x:Key="SSPassword">SS Pwd</sys:String>
|
||||
<sys:String x:Key="SSMethods">SS Method</sys:String>
|
||||
<sys:String x:Key="SSPort">SS Port</sys:String>
|
||||
<sys:String x:Key="TrojanPassword">Trojan Pwd</sys:String>
|
||||
<sys:String x:Key="TrojanPort">Trojan Port</sys:String>
|
||||
<sys:String x:Key="V2rayPort">v2ray Port</sys:String>
|
||||
<sys:String x:Key="XrayPort">xray Port</sys:String>
|
||||
<sys:String x:Key="XrayPortDefault">default port is 443</sys:String>
|
||||
|
||||
<sys:String x:Key="MoreParameters">More Parameters</sys:String>
|
||||
|
||||
<!--xray installer-->
|
||||
<sys:String x:Key="XrayInstallerInstall">Install</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUpdateSettings">UpdateSettings</sys:String>
|
||||
|
@ -104,19 +129,36 @@
|
|||
<sys:String x:Key="XrayInstallerInstallCert">InstallCert</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUploadWeb">UploadWeb</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUploadCert">UploadCert</sys:String>
|
||||
|
||||
|
||||
<!--Trojan-GO-->
|
||||
<sys:String x:Key="TrojanGoWithTLS">With TLS</sys:String>
|
||||
<sys:String x:Key="TrojanGoWithTLSDesc">Unchecked means upload your own TLS.</sys:String>
|
||||
<sys:String x:Key="TrojanGoDomain">Address</sys:String>
|
||||
<sys:String x:Key="TrojanGoPort">Port</sys:String>
|
||||
<sys:String x:Key="TrojanGoPassword">Password</sys:String>
|
||||
<sys:String x:Key="TrojanGoMaskDomain">GuiseHost</sys:String>
|
||||
<sys:String x:Key="TrojanGoWebSocketPath">WS Path</sys:String>
|
||||
<sys:String x:Key="TrojanGoWebSocketDomain">WS Domain</sys:String>
|
||||
|
||||
|
||||
<!--Naive Proxy-->
|
||||
<sys:String x:Key="NaiveProxyDomain">Address</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPort">Port</sys:String>
|
||||
<sys:String x:Key="NaiveProxyUserName">UserName</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPassword">Password</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">GuiseHost</sys:String>
|
||||
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">Address</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">Port</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">Cleantext</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">Secret</sys:String>
|
||||
|
||||
<!--Hysteria-->
|
||||
<sys:String x:Key="HysteriaDomain">Address</sys:String>
|
||||
<sys:String x:Key="HysteriaPort">Port</sys:String>
|
||||
<sys:String x:Key="HysteriaObfs">OBFS</sys:String>
|
||||
<sys:String x:Key="HysteriaProtocol">Protocol</sys:String>
|
||||
<sys:String x:Key="HysteriaEmail">Email</sys:String>
|
||||
<sys:String x:Key="HysteriaUpMbps">UpMbps</sys:String>
|
||||
<sys:String x:Key="HysteriaDownMbps">DownMbps</sys:String>
|
||||
</ResourceDictionary>
|
164
ProxySuper.WPF/Resources/Languages/fa_IR.xaml
Normal file
164
ProxySuper.WPF/Resources/Languages/fa_IR.xaml
Normal file
|
@ -0,0 +1,164 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--common-->
|
||||
<sys:String x:Key="Random">تصادفی</sys:String>
|
||||
<sys:String x:Key="Save">ذخیره</sys:String>
|
||||
<sys:String x:Key="SaveAndInstall">ذخیره و نصب</sys:String>
|
||||
<sys:String x:Key="SaveAs">ذخیره به عنوان</sys:String>
|
||||
<sys:String x:Key="Install">نصب</sys:String>
|
||||
<sys:String x:Key="Settings">تنظیمات</sys:String>
|
||||
<sys:String x:Key="ReadmeWebsiteDemo">موارد زیر یک اتصال صفحه وب ثابت است که توسط کاربران اینترنتی ارائه شده است، لطفاً بررسی کنید که آیا فایل index.html توسط خودتان وجود دارد یا خیر.</sys:String>
|
||||
|
||||
<!--Main Menu-->
|
||||
<sys:String x:Key="MainMenuAddHost">میزبان اضافه کنید</sys:String>
|
||||
<sys:String x:Key="MainMenuActions">عمل کنند</sys:String>
|
||||
<sys:String x:Key="MainMenuActionsExportSettings">پیکربندی صادرات</sys:String>
|
||||
<sys:String x:Key="MainMenuActionsExportSubscribe">اشتراک صادرات</sys:String>
|
||||
<sys:String x:Key="MainMenuActionsGetRoot">اکانت روت را فعال کنید</sys:String>
|
||||
|
||||
<sys:String x:Key="MainMenuLanguage">زبان(Language)</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageCn">中文</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageTw">正體</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageFr">فارسی</sys:String>
|
||||
|
||||
<sys:String x:Key="MainMenuHelper">یاور</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperGithub">Github</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperUseRoot">اکانت روت را فعال کنید</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperCertQuestion">در مورد گواهینامه</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperPrivateKey">در مورد سوال</sys:String>
|
||||
|
||||
<!--Main DataGrid-->
|
||||
<sys:String x:Key="MainDataGridColumnTag">برچسب</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnAddress">آدرس</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnType">نوع</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnAction">عمل کنند</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionInstall">نصب</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionEdit">ویرایش</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionViewConfig">مشاهده پیکربندی</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionDelete">حذف</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortUp">بالاا</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortDone">پایین</sys:String>
|
||||
|
||||
|
||||
<!--Editor Window-->
|
||||
<sys:String x:Key="HostGroupName">هاست</sys:String>
|
||||
<sys:String x:Key="HostTag">برچسب</sys:String>
|
||||
<sys:String x:Key="HostAddress">آدرس</sys:String>
|
||||
<sys:String x:Key="HostUserName">نام کاربری</sys:String>
|
||||
<sys:String x:Key="HostPassword">رمز عبور</sys:String>
|
||||
<sys:String x:Key="HostPort">پورت</sys:String>
|
||||
<sys:String x:Key="HostSecretType">نوع تأیید ورود</sys:String>
|
||||
<sys:String x:Key="HostUploadSecretKey">کلید آپلود</sys:String>
|
||||
<sys:String x:Key="HostSertTypePassword">رمز عبور</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKey">کلید خصوصی</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">رمز عبور PK</sys:String>
|
||||
|
||||
|
||||
<sys:String x:Key="ProxyGroupName">پروکسی</sys:String>
|
||||
<sys:String x:Key="ProxyAddress">آدرس</sys:String>
|
||||
<sys:String x:Key="ProxyPort">پورت</sys:String>
|
||||
<sys:String x:Key="ProxyUserName">نام کاربری</sys:String>
|
||||
<sys:String x:Key="ProxyPassword">رمز عبور</sys:String>
|
||||
<sys:String x:Key="ProxyType">نوع</sys:String>
|
||||
<sys:String x:Key="ProxyTypeNone">None</sys:String>
|
||||
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
|
||||
<sys:String x:Key="ProxyTypeSocks5">ساکس5</sys:String>
|
||||
|
||||
<!--editor-->
|
||||
<sys:String x:Key="EditorProxyType" xml:space="preserve">نوع پروکسی</sys:String>
|
||||
<sys:String x:Key="EditorProxyParams" xml:space="preserve">Params</sys:String>
|
||||
|
||||
<!--Xray-->
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS XTLS</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS TCP</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS WS</sys:String>
|
||||
<sys:String x:Key="VlessRpcDesc" xml:space="preserve">VLESS gRPC</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP</sys:String>
|
||||
<sys:String x:Key="VlessQuicDesc" xml:space="preserve">VLESS QUIC</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS WS</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP</sys:String>
|
||||
<sys:String x:Key="VmessQuicDesc" xml:space="preserve">VMESS QUIC</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan</sys:String>
|
||||
|
||||
<sys:String x:Key="XrayDomain">Domain/IP</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">Redir Url</sys:String>
|
||||
<sys:String x:Key="XrayWithTLS">With TLS</sys:String>
|
||||
<sys:String x:Key="XrayWithTLSDesc">Unchecked means upload your own TLS.</sys:String>
|
||||
<sys:String x:Key="XrayUUID">UUID</sys:String>
|
||||
<sys:String x:Key="Flow">Flow</sys:String>
|
||||
<sys:String x:Key="UTLS">uTLS</sys:String>
|
||||
<sys:String x:Key="MultiUser">چند کاربره</sys:String>
|
||||
<sys:String x:Key="MultiUserHelp">چند شناسه تقسیم با ","</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="VlessQuicPort">VLESS QUIC Port</sys:String>
|
||||
<sys:String x:Key="VlessQuicKey">VLESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VlessQuicSecurity">VLESS QUIC Security</sys:String>
|
||||
<sys:String x:Key="VlessQuicType">VLESS QUIC Type</sys:String>
|
||||
<sys:String x:Key="VlessRPCName">gRPC Service Name</sys:String>
|
||||
<sys:String x:Key="VlessRPCPort">gRPC 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="VmessQuicKey">VMESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VmessQuicPort">VMESS QUIC Port</sys:String>
|
||||
<sys:String x:Key="VmessQuicSecurity">VMESS QUIC Security</sys:String>
|
||||
<sys:String x:Key="VmessQuicType">VMESS QUIC Type</sys:String>
|
||||
<sys:String x:Key="SSPassword">SS Pwd</sys:String>
|
||||
<sys:String x:Key="SSMethods">SS Method</sys:String>
|
||||
<sys:String x:Key="SSPort">SS Port</sys:String>
|
||||
<sys:String x:Key="TrojanPassword">Trojan Pwd</sys:String>
|
||||
<sys:String x:Key="TrojanPort">پورت تروجان</sys:String>
|
||||
<sys:String x:Key="V2rayPort">v2ray بندر</sys:String>
|
||||
<sys:String x:Key="XrayPort">xray بندر</sys:String>
|
||||
<sys:String x:Key="XrayPortDefault">پورت پیش فرض 443 است</sys:String>
|
||||
<sys:String x:Key="MoreParameters">پارامترهای بیشتر</sys:String>
|
||||
|
||||
<!--xray installer-->
|
||||
<sys:String x:Key="XrayInstallerInstall">نصب</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUpdateSettings">بروزرسانی تنظیمات</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUpdateCore">بروزرسانی هسته</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUninstall">Uninstall</sys:String>
|
||||
<sys:String x:Key="XrayInstallerInstallCert">InstallCert</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUploadWeb">UploadWeb</sys:String>
|
||||
<sys:String x:Key="XrayInstallerUploadCert">UploadCert</sys:String>
|
||||
|
||||
<!--Trojan-GO-->
|
||||
<sys:String x:Key="TrojanGoWithTLS">With TLS</sys:String>
|
||||
<sys:String x:Key="TrojanGoWithTLSDesc">Unchecked means upload your own TLS.</sys:String>
|
||||
<sys:String x:Key="TrojanGoDomain">آدرس</sys:String>
|
||||
<sys:String x:Key="TrojanGoPort">پورت</sys:String>
|
||||
<sys:String x:Key="TrojanGoPassword">رمزعبور</sys:String>
|
||||
<sys:String x:Key="TrojanGoMaskDomain">GuiseHost</sys:String>
|
||||
<sys:String x:Key="TrojanGoWebSocketPath">WS Path</sys:String>
|
||||
<sys:String x:Key="TrojanGoWebSocketDomain">WS Domain</sys:String>
|
||||
|
||||
<!--Naive Proxy-->
|
||||
<sys:String x:Key="NaiveProxyDomain">آدرس</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPort">پورت</sys:String>
|
||||
<sys:String x:Key="NaiveProxyUserName">نام کاربری</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPassword">رمز عبور</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">GuiseHost</sys:String>
|
||||
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">آدرس</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">پورت</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">Cleantext</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">رمز</sys:String>
|
||||
|
||||
<!--Hysteria-->
|
||||
<sys:String x:Key="HysteriaDomain">آدرس</sys:String>
|
||||
<sys:String x:Key="HysteriaPort">پورت</sys:String>
|
||||
<sys:String x:Key="HysteriaObfs">OBFS</sys:String>
|
||||
<sys:String x:Key="HysteriaProtocol">Protocol</sys:String>
|
||||
<sys:String x:Key="HysteriaEmail">ایمیل</sys:String>
|
||||
<sys:String x:Key="HysteriaUpMbps">UpMbps</sys:String>
|
||||
<sys:String x:Key="HysteriaDownMbps">DownMbps</sys:String>
|
||||
</ResourceDictionary>
|
|
@ -5,6 +5,7 @@
|
|||
<!--common-->
|
||||
<sys:String x:Key="Random">隨機</sys:String>
|
||||
<sys:String x:Key="Save">保存</sys:String>
|
||||
<sys:String x:Key="SaveAndInstall">保存并安裝</sys:String>
|
||||
<sys:String x:Key="SaveAs">另存為</sys:String>
|
||||
<sys:String x:Key="Install">安裝</sys:String>
|
||||
<sys:String x:Key="Settings">配置</sys:String>
|
||||
|
@ -21,6 +22,8 @@
|
|||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageCn">中文</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageTw">正體</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageFr">فارسی</sys:String>
|
||||
|
||||
<sys:String x:Key="MainMenuHelper">幫助</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperGithub">Github</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperUseRoot">啓用Root賬戶</sys:String>
|
||||
|
@ -37,6 +40,8 @@
|
|||
<sys:String x:Key="MainDataGridColumnActionEdit">編輯</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionViewConfig">查看配置</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionDelete">刪除</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortUp">上移</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortDone">下移</sys:String>
|
||||
|
||||
|
||||
<!--Editor Window-->
|
||||
|
@ -50,6 +55,7 @@
|
|||
<sys:String x:Key="HostUploadSecretKey">上傳Key</sys:String>
|
||||
<sys:String x:Key="HostSertTypePassword">密碼</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKey">私鑰</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">私鑰密碼</sys:String>
|
||||
|
||||
<sys:String x:Key="ProxyGroupName">代理</sys:String>
|
||||
<sys:String x:Key="ProxyAddress">IP/地址</sys:String>
|
||||
|
@ -61,39 +67,60 @@
|
|||
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
|
||||
<sys:String x:Key="ProxyTypeSocks5">Socks5</sys:String>
|
||||
|
||||
<!--editor-->
|
||||
<sys:String x:Key="EditorProxyType" xml:space="preserve">節點類型</sys:String>
|
||||
<sys:String x:Key="EditorProxyParams" xml:space="preserve">節點參數</sys:String>
|
||||
|
||||
<!--Xray-->
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS Over TCP With XTLS
性能數倍,首選方式。</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS
仍推薦XTLS。</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS
推薦,支持CDN。</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP
遊戲推薦,延遲低,免域名。</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS
推薦,支持CDN。</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP
遊戲推薦,延遲低,免域名。</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks
SS,支持udp,免域名。</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS
Trojan。</sys:String>
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS TCP XTLS</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS TCP</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS WS</sys:String>
|
||||
<sys:String x:Key="VlessRpcDesc" xml:space="preserve">VLESS gRPC</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP</sys:String>
|
||||
<sys:String x:Key="VlessQuicDesc" xml:space="preserve">VLESS QUIC</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS WS</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP</sys:String>
|
||||
<sys:String x:Key="VmessQuicDesc" xml:space="preserve">VMESS QUIC</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan</sys:String>
|
||||
|
||||
|
||||
<sys:String x:Key="XrayDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">偽裝域名</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">偽裝網址</sys:String>
|
||||
<sys:String x:Key="XrayWithTLS">自動申請證書</sys:String>
|
||||
<sys:String x:Key="XrayWithTLSDesc">如上傳自有證書,則取消對勾。</sys:String>
|
||||
<sys:String x:Key="XrayUUID">UUID</sys:String>
|
||||
<sys:String x:Key="Flow">流控</sys:String>
|
||||
<sys:String x:Key="UTLS">uTLS</sys:String>
|
||||
<sys:String x:Key="MultiUser">多用戶</sys:String>
|
||||
<sys:String x:Key="MultiUserHelp">多個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="VlessQuicKey">VLESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VlessQuicPort">VLESS QUIC端口</sys:String>
|
||||
<sys:String x:Key="VlessQuicSecurity">VLESS QUIC加密</sys:String>
|
||||
<sys:String x:Key="VlessQuicType">VLESS QUIC僞裝</sys:String>
|
||||
<sys:String x:Key="VlessRPCName">gRPC路徑</sys:String>
|
||||
<sys:String x:Key="VlessRPCPort">gRPC端口</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="VmessQuicKey">VMESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VmessQuicPort">VMESS QUIC端口</sys:String>
|
||||
<sys:String x:Key="VmessQuicSecurity">VMESS QUIC加密</sys:String>
|
||||
<sys:String x:Key="VmessQuicType">VMESS QUIC僞裝</sys:String>
|
||||
<sys:String x:Key="SSPassword">SS密碼</sys:String>
|
||||
<sys:String x:Key="SSMethods">SS加密方式</sys:String>
|
||||
<sys:String x:Key="SSPort">SS端口</sys:String>
|
||||
<sys:String x:Key="TrojanPassword">Trojan密碼</sys:String>
|
||||
<sys:String x:Key="TrojanPort">Trojan端口</sys:String>
|
||||
<sys:String x:Key="XrayPort">xray端口</sys:String>
|
||||
<sys:String x:Key="V2rayPort">V2ray端口</sys:String>
|
||||
<sys:String x:Key="XrayPort">XRAY端口</sys:String>
|
||||
<sys:String x:Key="XrayPortDefault">默認端口443,不建議修改</sys:String>
|
||||
<sys:String x:Key="MoreParameters">更多參數</sys:String>
|
||||
|
||||
<!--xray installer-->
|
||||
<sys:String x:Key="XrayInstallerInstall">一鍵安裝</sys:String>
|
||||
|
@ -106,6 +133,8 @@
|
|||
|
||||
|
||||
<!--Trojan-GO-->
|
||||
<sys:String x:Key="TrojanGoWithTLS">自動申請證書</sys:String>
|
||||
<sys:String x:Key="TrojanGoWithTLSDesc">如上傳自有證書,則取消對勾。</sys:String>
|
||||
<sys:String x:Key="TrojanGoDomain">域名</sys:String>
|
||||
<sys:String x:Key="TrojanGoPort">端口</sys:String>
|
||||
<sys:String x:Key="TrojanGoPassword">密碼</sys:String>
|
||||
|
@ -119,4 +148,19 @@
|
|||
<sys:String x:Key="NaiveProxyUserName">用戶名</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPassword">密碼</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">偽裝網站</sys:String>
|
||||
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">密鑰</sys:String>
|
||||
|
||||
<!--Hysteria-->
|
||||
<sys:String x:Key="HysteriaDomain">域名</sys:String>
|
||||
<sys:String x:Key="HysteriaPort">端口</sys:String>
|
||||
<sys:String x:Key="HysteriaObfs">加密字符</sys:String>
|
||||
<sys:String x:Key="HysteriaEmail">郵箱</sys:String>
|
||||
<sys:String x:Key="HysteriaProtocol">協議</sys:String>
|
||||
<sys:String x:Key="HysteriaUpMbps">上傳限速</sys:String>
|
||||
<sys:String x:Key="HysteriaDownMbps">下載限速</sys:String>
|
||||
</ResourceDictionary>
|
|
@ -5,6 +5,7 @@
|
|||
<!--common-->
|
||||
<sys:String x:Key="Random">随机</sys:String>
|
||||
<sys:String x:Key="Save">保存</sys:String>
|
||||
<sys:String x:Key="SaveAndInstall">保存并安装</sys:String>
|
||||
<sys:String x:Key="SaveAs">另存为</sys:String>
|
||||
<sys:String x:Key="Install">安装</sys:String>
|
||||
<sys:String x:Key="Settings">配置</sys:String>
|
||||
|
@ -21,6 +22,8 @@
|
|||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageCn">中文</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageTw">正體</sys:String>
|
||||
<sys:String x:Key="MainMenuLanguageFr">فارسی</sys:String>
|
||||
|
||||
<sys:String x:Key="MainMenuHelper">帮助</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperGithub">Github</sys:String>
|
||||
<sys:String x:Key="MainMenuHelperUseRoot">启用Root账户</sys:String>
|
||||
|
@ -37,6 +40,8 @@
|
|||
<sys:String x:Key="MainDataGridColumnActionEdit">编辑</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionViewConfig">查看配置</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionDelete">删除</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortUp">上移</sys:String>
|
||||
<sys:String x:Key="MainDataGridColumnActionSortDone">下移</sys:String>
|
||||
|
||||
|
||||
|
||||
|
@ -51,6 +56,7 @@
|
|||
<sys:String x:Key="HostUploadSecretKey">上传Key</sys:String>
|
||||
<sys:String x:Key="HostSertTypePassword">密码</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKey">私钥</sys:String>
|
||||
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">私钥密码</sys:String>
|
||||
|
||||
<sys:String x:Key="ProxyGroupName">代理</sys:String>
|
||||
<sys:String x:Key="ProxyAddress">IP/地址</sys:String>
|
||||
|
@ -62,39 +68,60 @@
|
|||
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
|
||||
<sys:String x:Key="ProxyTypeSocks5">Socks5</sys:String>
|
||||
|
||||
<!--editor-->
|
||||
<sys:String x:Key="EditorProxyType" xml:space="preserve">节点类型</sys:String>
|
||||
<sys:String x:Key="EditorProxyParams" xml:space="preserve">节点参数</sys:String>
|
||||
|
||||
<!--Xray-->
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS Over TCP With XTLS
性能数倍,首选方式。</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS
仍推荐XTLS。</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS
推荐,支持CDN。</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP
游戏推荐,延迟低,免域名。</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS
推荐,支持CDN。</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP
游戏推荐,延迟低,免域名。</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks
SS,支持udp,免域名。</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS
Trojan。</sys:String>
|
||||
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS TCP XTLS</sys:String>
|
||||
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS TCP</sys:String>
|
||||
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS WS</sys:String>
|
||||
<sys:String x:Key="VlessRpcDesc" xml:space="preserve">VLESS gRPC</sys:String>
|
||||
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP</sys:String>
|
||||
<sys:String x:Key="VlessQuicDesc" xml:space="preserve">VLESS QUIC</sys:String>
|
||||
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS WS</sys:String>
|
||||
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP</sys:String>
|
||||
<sys:String x:Key="VmessQuicDesc" xml:space="preserve">VMESS QUIC</sys:String>
|
||||
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks</sys:String>
|
||||
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan</sys:String>
|
||||
|
||||
|
||||
<sys:String x:Key="XrayDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">伪装域名</sys:String>
|
||||
<sys:String x:Key="XrayMarkDomain">伪装网址</sys:String>
|
||||
<sys:String x:Key="XrayWithTLS">自动申请证书</sys:String>
|
||||
<sys:String x:Key="XrayWithTLSDesc">如上传自有证书,则取消对勾。</sys:String>
|
||||
<sys:String x:Key="XrayUUID">UUID</sys:String>
|
||||
<sys:String x:Key="Flow">流控</sys:String>
|
||||
<sys:String x:Key="UTLS">uTLS</sys:String>
|
||||
<sys:String x:Key="MultiUser">多用户</sys:String>
|
||||
<sys:String x:Key="MultiUserHelp">多个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="VlessQuicKey">VLESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VlessQuicPort">VLESS QUIC端口</sys:String>
|
||||
<sys:String x:Key="VlessQuicSecurity">VLESS QUIC加密</sys:String>
|
||||
<sys:String x:Key="VlessQuicType">VLESS QUIC伪装</sys:String>
|
||||
<sys:String x:Key="VlessRPCName">gRPC路径</sys:String>
|
||||
<sys:String x:Key="VlessRPCPort">gRPC端口</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="VmessQuicKey">VMESS QUIC Key</sys:String>
|
||||
<sys:String x:Key="VmessQuicPort">VMESS QUIC端口</sys:String>
|
||||
<sys:String x:Key="VmessQuicSecurity">VMESS QUIC加密</sys:String>
|
||||
<sys:String x:Key="VmessQuicType">VMESS QUIC伪装</sys:String>
|
||||
<sys:String x:Key="SSPassword">SS密码</sys:String>
|
||||
<sys:String x:Key="SSMethods">SS加密方式</sys:String>
|
||||
<sys:String x:Key="SSPort">SS端口</sys:String>
|
||||
<sys:String x:Key="TrojanPassword">Trojan密码</sys:String>
|
||||
<sys:String x:Key="TrojanPort">Trojan端口</sys:String>
|
||||
<sys:String x:Key="XrayPort">xray端口</sys:String>
|
||||
<sys:String x:Key="V2rayPort">V2ray端口</sys:String>
|
||||
<sys:String x:Key="XrayPort">XRAY端口</sys:String>
|
||||
<sys:String x:Key="XrayPortDefault">默认端口443,不建议修改</sys:String>
|
||||
<sys:String x:Key="MoreParameters">更多参数</sys:String>
|
||||
|
||||
<!--xray installer-->
|
||||
<sys:String x:Key="XrayInstallerInstall">一键安装</sys:String>
|
||||
|
@ -107,6 +134,8 @@
|
|||
|
||||
|
||||
<!--Trojan-GO-->
|
||||
<sys:String x:Key="TrojanGoWithTLS">自动申请证书</sys:String>
|
||||
<sys:String x:Key="TrojanGoWithTLSDesc">如上传自有证书,则取消对勾。</sys:String>
|
||||
<sys:String x:Key="TrojanGoDomain">域名</sys:String>
|
||||
<sys:String x:Key="TrojanGoPort">端口</sys:String>
|
||||
<sys:String x:Key="TrojanGoPassword">密码</sys:String>
|
||||
|
@ -120,4 +149,19 @@
|
|||
<sys:String x:Key="NaiveProxyUserName">用户名</sys:String>
|
||||
<sys:String x:Key="NaiveProxyPassword">密码</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">伪装网站</sys:String>
|
||||
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">密钥</sys:String>
|
||||
|
||||
<!--Hysteria-->
|
||||
<sys:String x:Key="HysteriaDomain">域名</sys:String>
|
||||
<sys:String x:Key="HysteriaPort">端口</sys:String>
|
||||
<sys:String x:Key="HysteriaObfs">加密字符</sys:String>
|
||||
<sys:String x:Key="HysteriaProtocol">协议</sys:String>
|
||||
<sys:String x:Key="HysteriaEmail">邮箱</sys:String>
|
||||
<sys:String x:Key="HysteriaUpMbps">上传限速</sys:String>
|
||||
<sys:String x:Key="HysteriaDownMbps">下载限速</sys:String>
|
||||
</ResourceDictionary>
|
23
ProxySuper.WPF/Setup.cs
Normal file
23
ProxySuper.WPF/Setup.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using MvvmCross.Platforms.Wpf.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.WPF
|
||||
{
|
||||
public class Setup : MvxWpfSetup<Core.App>
|
||||
{
|
||||
protected override ILoggerProvider CreateLogProvider()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override ILoggerFactory CreateLogFactory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
10
ProxySuper.WPF/Templates/Hysteria/config.json
Normal file
10
ProxySuper.WPF/Templates/Hysteria/config.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"listen": ":36712",
|
||||
"acme": {
|
||||
"domains": [
|
||||
"your.domain.com"
|
||||
],
|
||||
"email": "your@email.com"
|
||||
},
|
||||
"obfs": "8ZuA2Zpqhuk8yakXvMjDqEXBwY"
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"log_level": 5,
|
||||
"run_type": "server",
|
||||
"local_addr": "0.0.0.0",
|
||||
"local_port": 443,
|
||||
|
@ -8,8 +9,8 @@
|
|||
""
|
||||
],
|
||||
"ssl": {
|
||||
"cert": "/usr/local/etc/trojan-go/trojan-go.crt",
|
||||
"key": "/usr/local/etc/trojan-go/trojan-go.key",
|
||||
"cert": "/usr/local/etc/trojan-go/ssl/trojan-go.crt",
|
||||
"key": "/usr/local/etc/trojan-go/ssl/trojan-go.key",
|
||||
"sni": "example.com"
|
||||
},
|
||||
"websocket": {
|
||||
|
|
12
ProxySuper.WPF/Templates/v2ray/base.json
Normal file
12
ProxySuper.WPF/Templates/v2ray/base.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"log": {},
|
||||
"api": {},
|
||||
"dns": {},
|
||||
"routing": {},
|
||||
"policy": {},
|
||||
"inbounds": [],
|
||||
"outbounds": [],
|
||||
"transport": {},
|
||||
"stats": {},
|
||||
"reverse": {}
|
||||
}
|
9
ProxySuper.WPF/Templates/v2ray/caddy/base.caddyfile
Normal file
9
ProxySuper.WPF/Templates/v2ray/caddy/base.caddyfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
:##port## {
|
||||
root * /usr/share/caddy
|
||||
file_server
|
||||
##reverse_proxy##
|
||||
}
|
||||
|
||||
##domain##:80 {
|
||||
redir https://##domain##{uri}
|
||||
}
|
5
ProxySuper.WPF/Templates/v2ray/client/00_log/00_log.json
Normal file
5
ProxySuper.WPF/Templates/v2ray/client/00_log/00_log.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
}
|
||||
}
|
3
ProxySuper.WPF/Templates/v2ray/client/01_api/01_api.json
Normal file
3
ProxySuper.WPF/Templates/v2ray/client/01_api/01_api.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"api": null
|
||||
}
|
3
ProxySuper.WPF/Templates/v2ray/client/02_dns/02_dns.json
Normal file
3
ProxySuper.WPF/Templates/v2ray/client/02_dns/02_dns.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"dns": {}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"routing": {}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"policy": {}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "http",
|
||||
"port": 1081
|
||||
},
|
||||
{
|
||||
"port": 1080,
|
||||
"protocol": "socks",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"udp": true,
|
||||
"auth": "noauth"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue