Support new kcp config (#9477)

This commit is contained in:
DHR60
2026-06-05 07:08:57 +00:00
committed by GitHub
parent da65faa49f
commit abcdd9497c
3 changed files with 14 additions and 12 deletions
+6 -6
View File
@@ -330,12 +330,12 @@ public class Global
public static readonly Dictionary<string, string> KcpHeaderMaskMap = new() public static readonly Dictionary<string, string> KcpHeaderMaskMap = new()
{ {
{ "srtp", "header-srtp" }, { "srtp", "srtp" },
{ "utp", "header-utp" }, { "utp", "utp" },
{ "wechat-video", "header-wechat" }, { "wechat-video", "wechat" },
{ "dtls", "header-dtls" }, { "dtls", "dtls" },
{ "wireguard", "header-wireguard" }, { "wireguard", "wireguard" },
{ "dns", "header-dns" } { "dns", "dns" }
}; };
public static readonly List<string> CoreTypes = public static readonly List<string> CoreTypes =
@@ -501,8 +501,10 @@ public class Mask4Ray
public class MaskSettings4Ray public class MaskSettings4Ray
{ {
public string? header { get; set; }
public string? value { get; set; }
public string? password { get; set; } public string? password { get; set; }
public string? domain { get; set; }
// fragment // fragment
public string? packets { get; set; } public string? packets { get; set; }
@@ -465,8 +465,8 @@ public partial class CoreConfigV2rayService
[ [
new Mask4Ray new Mask4Ray
{ {
type = header, type = "mkcp-legacy",
settings = null settings = new MaskSettings4Ray { header = header },
} }
]; ];
} }
@@ -475,15 +475,15 @@ public partial class CoreConfigV2rayService
{ {
kcpFinalmask.udp.Add(new Mask4Ray kcpFinalmask.udp.Add(new Mask4Ray
{ {
type = "mkcp-original" type = "mkcp-legacy",
}); });
} }
else else
{ {
kcpFinalmask.udp.Add(new Mask4Ray kcpFinalmask.udp.Add(new Mask4Ray
{ {
type = "mkcp-aes128gcm", type = "mkcp-legacy",
settings = new MaskSettings4Ray { password = kcpSeed } settings = new MaskSettings4Ray { value = kcpSeed },
}); });
} }
streamSettings.kcpSettings = kcpSettings; streamSettings.kcpSettings = kcpSettings;