mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
Fix fragment packet selection for REALITY (#10428)
This commit is contained in:
@@ -809,8 +809,6 @@ public partial class CoreConfigV2rayService
|
||||
&& (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true))
|
||||
.ToList();
|
||||
|
||||
var fragmentMask = BuildFragmentsMasks();
|
||||
|
||||
foreach (var outbound in actOutboundWithTlsList)
|
||||
{
|
||||
var finalMaskJsonObj = JsonUtils.ParseJson(JsonUtils.Serialize(outbound.streamSettings?.finalmask)) as JsonObject ?? new JsonObject();
|
||||
@@ -818,6 +816,13 @@ public partial class CoreConfigV2rayService
|
||||
var tcpFinalmaskList = finalMaskJsonObj["tcp"] as JsonArray ?? [];
|
||||
if (tcpFinalmaskList.Count == 0)
|
||||
{
|
||||
var fragmentMask = BuildFragmentsMasks();
|
||||
// Xray's tlshello fragment is incompatible with REALITY.
|
||||
if (outbound.streamSettings.security == Global.StreamSecurityReality
|
||||
&& fragmentMask.settings?.packets == "tlshello")
|
||||
{
|
||||
fragmentMask.settings!.packets = "1-3";
|
||||
}
|
||||
tcpFinalmaskList.Add(JsonUtils.SerializeToNode(fragmentMask));
|
||||
finalMaskJsonObj["tcp"] = tcpFinalmaskList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user