Skip to content

Commit 2caec72

Browse files
authored
Protect xhttp split address (2dust#8970)
1 parent 194c240 commit 2caec72

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ private static NodeValidatorResult RegisterSingleNodeAsync(CoreConfigContext con
322322
context.ProtectDomainList.Add(address);
323323
}
324324

325+
// ech query server name protect
325326
if (!node.EchConfigList.IsNullOrEmpty())
326327
{
327328
var echQuerySni = node.Sni;
@@ -338,6 +339,20 @@ private static NodeValidatorResult RegisterSingleNodeAsync(CoreConfigContext con
338339
}
339340
}
340341

342+
// xhttp downloadSettings address protect
343+
if (!string.IsNullOrEmpty(node.Extra)
344+
&& JsonUtils.ParseJson(node.Extra) is JsonObject extra
345+
&& extra.TryGetPropertyValue("downloadSettings", out var dsNode)
346+
&& dsNode is JsonObject downloadSettings
347+
&& downloadSettings.TryGetPropertyValue("address", out var dAddrNode)
348+
&& dAddrNode is JsonValue dAddrValue
349+
&& dAddrValue.TryGetValue(out string? dAddr)
350+
&& !string.IsNullOrEmpty(dAddr)
351+
&& Utils.IsDomain(dAddr))
352+
{
353+
context.ProtectDomainList.Add(dAddr);
354+
}
355+
341356
return nodeValidatorResult;
342357
}
343358

0 commit comments

Comments
 (0)