mirror of
https://github.com/2dust/v2rayN.git
synced 2026-03-02 22:23:05 +00:00
Compare commits
1 commit
2a10634957
...
c201395648
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c201395648 |
3 changed files with 13 additions and 36 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue