mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Fix review issue
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
"Transfer Protocol": "传输协议",
|
||||
"Fake Type": "伪装类型",
|
||||
"Host": "主机",
|
||||
"Path": "路径",
|
||||
"Path": "路径/服务名称",
|
||||
"QUIC Security": "QUIC 加密方式",
|
||||
"QUIC Secret": "QUIC 加密密钥",
|
||||
"GRPC Mode": "QUIC 模式",
|
||||
|
||||
@@ -284,5 +284,7 @@ namespace Netch.Servers.Models
|
||||
public class GrpcSettings
|
||||
{
|
||||
public string serviceName { get; set; }
|
||||
|
||||
public bool multiMode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
public string net { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 伪装路径
|
||||
/// 伪装路径/服务名称
|
||||
/// </summary>
|
||||
public string? path { get; set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -313,9 +313,15 @@ namespace Netch.Servers.Utils
|
||||
case "grpc":
|
||||
var grpcSettings = new GrpcSettings
|
||||
{
|
||||
serviceName = server.GRPCServiceName
|
||||
serviceName = server.Path,
|
||||
multiMode = false
|
||||
};
|
||||
|
||||
if (server.FakeType == "multi")
|
||||
{
|
||||
grpcSettings.multiMode = true;
|
||||
}
|
||||
|
||||
streamSettings.grpcSettings = grpcSettings;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -47,6 +47,10 @@ namespace Netch.Servers
|
||||
server.QUICSecret = parameter.Get("key") ?? "";
|
||||
server.FakeType = parameter.Get("headerType") ?? "none";
|
||||
break;
|
||||
case "grpc":
|
||||
server.FakeType = parameter.Get("mode") ?? "gun";
|
||||
server.Path = parameter.Get("serviceName") ?? "";
|
||||
break;
|
||||
}
|
||||
|
||||
server.TLSSecureType = parameter.Get("security") ?? "none";
|
||||
@@ -115,6 +119,14 @@ namespace Netch.Servers
|
||||
if (server.FakeType != "none")
|
||||
parameter.Add("headerType", server.FakeType);
|
||||
|
||||
break;
|
||||
case "grpc":
|
||||
if (!string.IsNullOrEmpty(server.Path))
|
||||
parameter.Add("serviceName", server.Path);
|
||||
|
||||
if (server.FakeType == "gun" || server.FakeType == "multi")
|
||||
parameter.Add("mode", server.FakeType);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,5 @@ namespace Netch.Servers
|
||||
public static List<string> TransferProtocols => VMessGlobal.TransferProtocols;
|
||||
|
||||
public static List<string> QUIC => VMessGlobal.QUIC;
|
||||
|
||||
public static List<string> GRPCModes => VMessGlobal.GRPCModes;
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,6 @@ namespace Netch.Servers.VLESSForm
|
||||
CreateTextBox("Path", "Path", s => true, s => server.Path = s, server.Path);
|
||||
CreateComboBox("QUICSecurity", "QUIC Security", VLESSGlobal.QUIC, s => server.QUICSecure = s, server.QUICSecure);
|
||||
CreateTextBox("QUICSecret", "QUIC Secret", s => true, s => server.QUICSecret = s, server.QUICSecret);
|
||||
CreateComboBox("GRPCMode", "GRPC Mode", VLESSGlobal.GRPCModes, s => server.GRPCMode = s, server.GRPCMode);
|
||||
CreateTextBox("GRPCServiceName", "GRPC ServiceName", s => true, s => server.GRPCServiceName = s, server.GRPCServiceName);
|
||||
CreateComboBox("UseMux",
|
||||
"Use Mux",
|
||||
new List<string> { "", "true", "false" },
|
||||
|
||||
@@ -23,8 +23,6 @@ namespace Netch.Servers.VMess.Form
|
||||
CreateTextBox("Path", "Path", s => true, s => server.Path = s, server.Path);
|
||||
CreateComboBox("QUICSecurity", "QUIC Security", VMessGlobal.QUIC, s => server.QUICSecure = s, server.QUICSecure);
|
||||
CreateTextBox("QUICSecret", "QUIC Secret", s => true, s => server.QUICSecret = s, server.QUICSecret);
|
||||
CreateComboBox("GRPCMode", "GRPC Mode", VMessGlobal.GRPCModes, s => server.GRPCMode = s, server.GRPCMode);
|
||||
CreateTextBox("GRPCServiceName", "GRPC ServiceName", s => true, s => server.GRPCServiceName = s, server.GRPCServiceName);
|
||||
CreateComboBox("UseMux",
|
||||
"Use Mux",
|
||||
new List<string> { "", "true", "false" },
|
||||
|
||||
@@ -54,16 +54,6 @@ namespace Netch.Servers.VMess
|
||||
/// </summary>
|
||||
public string? QUICSecret { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// GRPC 服务名称
|
||||
/// </summary>
|
||||
public string? GRPCServiceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// GRPC 模式
|
||||
/// </summary>
|
||||
public string? GRPCMode { get; set; } = VMessGlobal.GRPCModes[0];
|
||||
|
||||
/// <summary>
|
||||
/// TLS 底层传输安全
|
||||
/// </summary>
|
||||
@@ -102,12 +92,6 @@ namespace Netch.Servers.VMess
|
||||
"chacha20-poly1305"
|
||||
};
|
||||
|
||||
public static readonly List<string> GRPCModes = new List<string>()
|
||||
{
|
||||
"gun",
|
||||
"multi"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// V2Ray 传输协议
|
||||
/// </summary>
|
||||
@@ -132,7 +116,9 @@ namespace Netch.Servers.VMess
|
||||
"utp",
|
||||
"wechat-video",
|
||||
"dtls",
|
||||
"wireguard"
|
||||
"wireguard",
|
||||
"gun",
|
||||
"multi"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user