Compare commits

..

2 commits

Author SHA1 Message Date
DHR60
e676f97550
Merge c201395648 into d589713fd5 2026-01-31 22:50:07 +08:00
DHR60
c201395648 Add xray v26.1.31 hysteria2 support 2026-01-31 22:48:19 +08:00
3 changed files with 13 additions and 36 deletions

View file

@ -288,16 +288,6 @@ public class Global
"dns"
];
public static readonly Dictionary<string, string> KcpHeaderMaskMap = new()
{
{ "srtp", "header-srtp" },
{ "utp", "header-utp" },
{ "wechat-video", "header-wechat" },
{ "dtls", "header-dtls" },
{ "wireguard", "header-wireguard" },
{ "dns", "header-dns" }
};
public static readonly List<string> CoreTypes =
[
"Xray",

View file

@ -388,6 +388,8 @@ public class Header4Ray
public object request { get; set; }
public object response { get; set; }
public string? domain { get; set; }
}
public class KcpSettings4Ray
@ -405,6 +407,10 @@ public class KcpSettings4Ray
public int readBufferSize { get; set; }
public int writeBufferSize { get; set; }
public Header4Ray header { get; set; }
public string seed { get; set; }
}
public class WsSettings4Ray
@ -493,7 +499,6 @@ public class Mask4Ray
public class MaskSettings4Ray
{
public string? password { get; set; }
public string? domain { get; set; }
}
public class AccountsItem4Ray

View file

@ -364,33 +364,14 @@ public partial class CoreConfigV2rayService
kcpSettings.congestion = _config.KcpItem.Congestion;
kcpSettings.readBufferSize = _config.KcpItem.ReadBufferSize;
kcpSettings.writeBufferSize = _config.KcpItem.WriteBufferSize;
streamSettings.finalmask ??= new();
if (Global.KcpHeaderMaskMap.TryGetValue(node.HeaderType, out var header))
kcpSettings.header = new Header4Ray
{
streamSettings.finalmask.udp =
[
new Mask4Ray
{
type = header,
settings = node.HeaderType == "dns" && !host.IsNullOrEmpty() ? new MaskSettings4Ray { domain = host } : null
}
];
}
streamSettings.finalmask.udp ??= [];
if (path.IsNullOrEmpty())
type = node.HeaderType,
domain = host.NullIfEmpty()
};
if (path.IsNotEmpty())
{
streamSettings.finalmask.udp.Add(new Mask4Ray
{
type = "mkcp-original"
});
}
else
{
streamSettings.finalmask.udp.Add(new Mask4Ray
{
type = "mkcp-aes128gcm",
settings = new MaskSettings4Ray { password = path }
});
kcpSettings.seed = path;
}
streamSettings.kcpSettings = kcpSettings;
break;
@ -539,6 +520,7 @@ public partial class CoreConfigV2rayService
type = "salamander",
settings = new MaskSettings4Ray { password = node.Path.TrimEx(), }
}
];
}
break;