mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-04 03:25:00 +03:00
Add xray v26.1.31 finalmask support (#8732)
* Add xray v26.1.31 hysteria2 support * Add xray v26.1.31 mkcp support
This commit is contained in:
@@ -365,14 +365,33 @@ public partial class CoreConfigV2rayService
|
||||
kcpSettings.congestion = _config.KcpItem.Congestion;
|
||||
kcpSettings.readBufferSize = _config.KcpItem.ReadBufferSize;
|
||||
kcpSettings.writeBufferSize = _config.KcpItem.WriteBufferSize;
|
||||
kcpSettings.header = new Header4Ray
|
||||
streamSettings.finalmask ??= new();
|
||||
if (Global.KcpHeaderMaskMap.TryGetValue(node.HeaderType, out var header))
|
||||
{
|
||||
type = node.HeaderType,
|
||||
domain = host.NullIfEmpty()
|
||||
};
|
||||
if (path.IsNotEmpty())
|
||||
streamSettings.finalmask.udp =
|
||||
[
|
||||
new Mask4Ray
|
||||
{
|
||||
type = header,
|
||||
settings = node.HeaderType == "dns" && !host.IsNullOrEmpty() ? new MaskSettings4Ray { domain = host } : null
|
||||
}
|
||||
];
|
||||
}
|
||||
streamSettings.finalmask.udp ??= [];
|
||||
if (path.IsNullOrEmpty())
|
||||
{
|
||||
kcpSettings.seed = path;
|
||||
streamSettings.finalmask.udp.Add(new Mask4Ray
|
||||
{
|
||||
type = "mkcp-original"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
streamSettings.finalmask.udp.Add(new Mask4Ray
|
||||
{
|
||||
type = "mkcp-aes128gcm",
|
||||
settings = new MaskSettings4Ray { password = path }
|
||||
});
|
||||
}
|
||||
streamSettings.kcpSettings = kcpSettings;
|
||||
break;
|
||||
@@ -513,8 +532,15 @@ public partial class CoreConfigV2rayService
|
||||
streamSettings.hysteriaSettings = hysteriaSettings;
|
||||
if (node.Path.IsNotEmpty())
|
||||
{
|
||||
streamSettings.udpmasks =
|
||||
[new() { type = "salamander", settings = new() { password = node.Path.TrimEx(), } }];
|
||||
streamSettings.finalmask ??= new();
|
||||
streamSettings.finalmask.udp =
|
||||
[
|
||||
new Mask4Ray
|
||||
{
|
||||
type = "salamander",
|
||||
settings = new MaskSettings4Ray { password = node.Path.TrimEx(), }
|
||||
}
|
||||
];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user