mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-25 22:56:09 +03:00
fix grpc
This commit is contained in:
parent
b82e857edd
commit
fe94157c7b
@ -42,13 +42,28 @@ namespace ProxySuper.Core.Models.Projects
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new List<int>
|
var list = new List<int>();
|
||||||
|
if (Types.Contains(XrayType.VLESS_KCP))
|
||||||
{
|
{
|
||||||
VLESS_KCP_Port,
|
list.Add(VLESS_KCP_Port);
|
||||||
VMESS_KCP_Port,
|
}
|
||||||
ShadowSocksPort,
|
|
||||||
VLESS_gRPC_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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ namespace ProxySuper.Core.Services
|
|||||||
public static int VLESS_TCP_Port = 1110;
|
public static int VLESS_TCP_Port = 1110;
|
||||||
public static int VLESS_WS_Port = 1111;
|
public static int VLESS_WS_Port = 1111;
|
||||||
public static int VLESS_H2_Port = 1112;
|
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_TCP_Port = 1210;
|
||||||
public static int VMESS_WS_Port = 1211;
|
public static int VMESS_WS_Port = 1211;
|
||||||
@ -127,7 +125,7 @@ namespace ProxySuper.Core.Services
|
|||||||
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
|
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
|
||||||
{
|
{
|
||||||
var gRPCInBound = GetBound("VLESS_gRPC.json");
|
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.settings.clients[0].id = parameters.UUID;
|
||||||
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
||||||
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;
|
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;
|
||||||
|
@ -113,7 +113,7 @@ namespace ProxySuper.Core.Services
|
|||||||
WriteOutput("卸载证书");
|
WriteOutput("卸载证书");
|
||||||
UninstallAcme();
|
UninstallAcme();
|
||||||
WriteOutput("关闭端口");
|
WriteOutput("关闭端口");
|
||||||
ClosePort(Parameters.ShadowSocksPort, Parameters.VMESS_KCP_Port);
|
ClosePort(Parameters.FreePorts.ToArray());
|
||||||
|
|
||||||
WriteOutput("************ 卸载完成 ************");
|
WriteOutput("************ 卸载完成 ************");
|
||||||
}
|
}
|
||||||
@ -137,12 +137,13 @@ namespace ProxySuper.Core.Services
|
|||||||
{
|
{
|
||||||
EnsureRootAuth();
|
EnsureRootAuth();
|
||||||
EnsureSystemEnv();
|
EnsureSystemEnv();
|
||||||
|
ConfigurePort();
|
||||||
ConfigureFirewall();
|
ConfigureFirewall();
|
||||||
var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters);
|
var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters);
|
||||||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(configJson));
|
var stream = new MemoryStream(Encoding.UTF8.GetBytes(configJson));
|
||||||
RunCmd("rm -rf /usr/local/etc/xray/config.json");
|
RunCmd("rm -rf /usr/local/etc/xray/config.json");
|
||||||
UploadFile(stream, "/usr/local/etc/xray/config.json");
|
UploadFile(stream, "/usr/local/etc/xray/config.json");
|
||||||
ConfigurePort();
|
|
||||||
UploadCaddyFile(string.IsNullOrEmpty(Parameters.MaskDomain));
|
UploadCaddyFile(string.IsNullOrEmpty(Parameters.MaskDomain));
|
||||||
RunCmd("systemctl restart xray");
|
RunCmd("systemctl restart xray");
|
||||||
WriteOutput("************ 更新Xray配置成功,更新配置不包含域名,如果域名更换请重新安装。 ************");
|
WriteOutput("************ 更新Xray配置成功,更新配置不包含域名,如果域名更换请重新安装。 ************");
|
||||||
|
@ -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
|
public bool Checked_VMESS_TCP
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<sys:String x:Key="MainMenuActions">Actions</sys:String>
|
<sys:String x:Key="MainMenuActions">Actions</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSettings">Export Settings</sys:String>
|
<sys:String x:Key="MainMenuActionsExportSettings">Export Settings</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSubscribe">Export Subscribe</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="MainMenuLanguage">Language</sys:String>
|
||||||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<sys:String x:Key="MainMenuActions">操作</sys:String>
|
<sys:String x:Key="MainMenuActions">操作</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSettings">導出配置</sys:String>
|
<sys:String x:Key="MainMenuActionsExportSettings">導出配置</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSubscribe">導出訂閲</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="MainMenuLanguage">語言(Language)</sys:String>
|
||||||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<sys:String x:Key="MainMenuActions">操作</sys:String>
|
<sys:String x:Key="MainMenuActions">操作</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSettings">导出配置</sys:String>
|
<sys:String x:Key="MainMenuActionsExportSettings">导出配置</sys:String>
|
||||||
<sys:String x:Key="MainMenuActionsExportSubscribe">导出订阅</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="MainMenuLanguage">语言(Language)</sys:String>
|
||||||
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<ctrl:VLESS_KCP_Control />
|
<ctrl:VLESS_KCP_Control />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
<TabItem Width="200"
|
<TabItem Width="200" Height="40"
|
||||||
Tag="{x:Static models:XrayType.VLESS_gRPC}"
|
Tag="{x:Static models:XrayType.VLESS_gRPC}"
|
||||||
IsEnabled="{Binding Checked_VLESS_gRPC}"
|
IsEnabled="{Binding Checked_VLESS_gRPC}"
|
||||||
Header="VLESS-gRPC">
|
Header="VLESS-gRPC">
|
||||||
|
Loading…
Reference in New Issue
Block a user