1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-21 20:56:08 +03:00
This commit is contained in:
autumn 2021-06-30 11:56:13 +08:00
parent b82e857edd
commit fe94157c7b
8 changed files with 38 additions and 13 deletions

View File

@ -42,13 +42,28 @@ namespace ProxySuper.Core.Models.Projects
{
get
{
return new List<int>
var list = new List<int>();
if (Types.Contains(XrayType.VLESS_KCP))
{
VLESS_KCP_Port,
VMESS_KCP_Port,
ShadowSocksPort,
VLESS_gRPC_Port,
};
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;
}
}

View File

@ -28,8 +28,6 @@ namespace ProxySuper.Core.Services
public static int VLESS_TCP_Port = 1110;
public static int VLESS_WS_Port = 1111;
public static int VLESS_H2_Port = 1112;
public static int VLESS_mKCP_Port = 1113;
public static int VLESS_gRPC_Port = 1114;
public static int VMESS_TCP_Port = 1210;
public static int VMESS_WS_Port = 1211;
@ -127,7 +125,7 @@ namespace ProxySuper.Core.Services
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
{
var gRPCInBound = GetBound("VLESS_gRPC.json");
gRPCInBound.port = VLESS_gRPC_Port;
gRPCInBound.port = parameters.VLESS_gRPC_Port;
gRPCInBound.settings.clients[0].id = parameters.UUID;
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;

View File

@ -113,7 +113,7 @@ namespace ProxySuper.Core.Services
WriteOutput("卸载证书");
UninstallAcme();
WriteOutput("关闭端口");
ClosePort(Parameters.ShadowSocksPort, Parameters.VMESS_KCP_Port);
ClosePort(Parameters.FreePorts.ToArray());
WriteOutput("************ 卸载完成 ************");
}
@ -137,12 +137,13 @@ namespace ProxySuper.Core.Services
{
EnsureRootAuth();
EnsureSystemEnv();
ConfigurePort();
ConfigureFirewall();
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");
ConfigurePort();
UploadCaddyFile(string.IsNullOrEmpty(Parameters.MaskDomain));
RunCmd("systemctl restart xray");
WriteOutput("************ 更新Xray配置成功更新配置不包含域名如果域名更换请重新安装。 ************");

View File

@ -56,6 +56,14 @@ namespace ProxySuper.Core.ViewModels
}
}
public bool Checked_VLESS_gRPC
{
get
{
return Settings.Types.Contains(XrayType.VLESS_gRPC);
}
}
public bool Checked_VMESS_TCP
{
get

View File

@ -15,6 +15,7 @@
<sys:String x:Key="MainMenuActions">Actions</sys:String>
<sys:String x:Key="MainMenuActionsExportSettings">Export Settings</sys:String>
<sys:String x:Key="MainMenuActionsExportSubscribe">Export Subscribe</sys:String>
<sys:String x:Key="MainMenuActionsGetRoot">Get Root</sys:String>
<sys:String x:Key="MainMenuLanguage">Language</sys:String>
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>

View File

@ -15,6 +15,7 @@
<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">啓用Root賬戶</sys:String>
<sys:String x:Key="MainMenuLanguage">語言(Language)</sys:String>
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>

View File

@ -15,6 +15,7 @@
<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">启用Root账户</sys:String>
<sys:String x:Key="MainMenuLanguage">语言(Language)</sys:String>
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>

View File

@ -51,9 +51,9 @@
<ctrl:VLESS_KCP_Control />
</TabItem>
<TabItem Width="200"
<TabItem Width="200" Height="40"
Tag="{x:Static models:XrayType.VLESS_gRPC}"
IsEnabled="{Binding Checked_VLESS_gRPC}"
IsEnabled="{Binding Checked_VLESS_gRPC}"
Header="VLESS-gRPC">
<ctrl:VLESS_gRPC_Control />
</TabItem>