1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-23 05:36:08 +03:00
ProxySU/ProxySU_Core/Models/XraySettings.cs

116 lines
2.8 KiB
C#
Raw Normal View History

2021-03-04 11:25:36 +03:00
using ProxySU_Core.ViewModels.Developers;
using System;
2021-02-25 04:59:06 +03:00
using System.Collections.Generic;
2021-03-04 11:25:36 +03:00
using System.Linq;
2021-02-25 04:59:06 +03:00
using System.Text;
2021-03-04 11:25:36 +03:00
using System.Threading.Tasks;
2021-02-25 04:59:06 +03:00
2021-03-04 11:25:36 +03:00
namespace ProxySU_Core.Models
2021-02-25 04:59:06 +03:00
{
2021-03-04 11:25:36 +03:00
public class XraySettings : IParameters
2021-02-25 04:59:06 +03:00
{
2021-03-04 11:25:36 +03:00
public XraySettings()
{
Port = 443;
UUID = Guid.NewGuid().ToString();
Types = new List<XrayType> { XrayType.VLESS_TCP_XTLS };
VLESS_WS_Path = "/vlessws";
VLESS_TCP_Path = "/vlesstcp";
VMESS_WS_Path = "/vmessws";
VMESS_TCP_Path = "/vmesstcp";
Trojan_TCP_Path = "/trojan";
TrojanPassword = Guid.NewGuid().ToString();
}
2021-02-25 04:59:06 +03:00
/// <summary>
/// 访问端口
/// </summary>
public int Port { get; set; }
/// <summary>
/// UUID
/// </summary>
public string UUID { get; set; }
/// <summary>
/// vless ws路径
/// </summary>
2021-03-04 11:25:36 +03:00
public string VLESS_WS_Path { get; set; }
2021-02-25 04:59:06 +03:00
/// <summary>
/// vless tcp路径
/// </summary>
2021-03-04 11:25:36 +03:00
public string VLESS_TCP_Path { get; set; }
2021-02-25 04:59:06 +03:00
/// <summary>
/// vmess ws路径
/// </summary>
2021-03-04 11:25:36 +03:00
public string VMESS_WS_Path { get; set; }
2021-02-25 04:59:06 +03:00
/// <summary>
/// vmess tcp路径
/// </summary>
2021-03-04 11:25:36 +03:00
public string VMESS_TCP_Path { get; set; }
2021-02-25 04:59:06 +03:00
/// <summary>
2021-02-28 09:19:26 +03:00
/// trojan tcp路径
/// </summary>
2021-03-04 11:25:36 +03:00
public string Trojan_TCP_Path { get; set; }
2021-02-28 09:19:26 +03:00
/// <summary>
/// trojan密码
2021-02-25 04:59:06 +03:00
/// </summary>
2021-02-28 09:19:26 +03:00
public string TrojanPassword { get; set; }
2021-02-25 04:59:06 +03:00
/// <summary>
/// 域名
/// </summary>
public string Domain { get; set; }
/// <summary>
/// 伪装域名
/// </summary>
public string MaskDomain { get; set; }
/// <summary>
/// 安装类型
/// </summary>
2021-03-04 11:25:36 +03:00
public List<XrayType> Types { get; set; }
2021-02-28 09:19:26 +03:00
2021-03-04 11:25:36 +03:00
public string GetPath(XrayType type)
2021-02-28 09:19:26 +03:00
{
2021-03-04 11:25:36 +03:00
switch (type)
2021-02-28 09:19:26 +03:00
{
case XrayType.VLESS_TCP_TLS:
2021-03-04 11:25:36 +03:00
return VLESS_TCP_Path;
2021-02-28 09:19:26 +03:00
case XrayType.VLESS_TCP_XTLS:
2021-03-04 11:25:36 +03:00
return VLESS_TCP_Path;
2021-02-28 09:19:26 +03:00
case XrayType.VLESS_WS_TLS:
2021-03-04 11:25:36 +03:00
return VLESS_WS_Path;
2021-02-28 09:19:26 +03:00
case XrayType.VMESS_TCP_TLS:
2021-03-04 11:25:36 +03:00
return VMESS_TCP_Path;
2021-02-28 09:19:26 +03:00
case XrayType.VMESS_WS_TLS:
2021-03-04 11:25:36 +03:00
return VMESS_WS_Path;
2021-02-28 09:19:26 +03:00
case XrayType.Trojan_TCP_TLS:
2021-03-04 11:25:36 +03:00
return Trojan_TCP_Path;
2021-02-28 09:19:26 +03:00
default:
return string.Empty;
}
}
2021-02-25 04:59:06 +03:00
}
public enum XrayType
{
2021-02-28 09:19:26 +03:00
VLESS_TCP_TLS,
VLESS_TCP_XTLS,
VLESS_WS_TLS,
VMESS_TCP_TLS,
VMESS_WS_TLS,
Trojan_TCP_TLS
2021-02-25 04:59:06 +03:00
}
}