Protect xhttp split address

This commit is contained in:
DHR60 2026-03-21 15:22:27 +08:00
parent 5fbcc46013
commit 748384d2b7

View file

@ -322,6 +322,7 @@ public class CoreConfigContextBuilder
context.ProtectDomainList.Add(address); context.ProtectDomainList.Add(address);
} }
// ech query server name protect
if (!node.EchConfigList.IsNullOrEmpty()) if (!node.EchConfigList.IsNullOrEmpty())
{ {
var echQuerySni = node.Sni; var echQuerySni = node.Sni;
@ -338,6 +339,20 @@ public class CoreConfigContextBuilder
} }
} }
// xhttp downloadSettings address protect
if (!string.IsNullOrEmpty(node.Extra)
&& JsonUtils.ParseJson(node.Extra) is JsonObject extra
&& extra.TryGetPropertyValue("downloadSettings", out var dsNode)
&& dsNode is JsonObject downloadSettings
&& downloadSettings.TryGetPropertyValue("address", out var dAddrNode)
&& dAddrNode is JsonValue dAddrValue
&& dAddrValue.TryGetValue(out string? dAddr)
&& !string.IsNullOrEmpty(dAddr)
&& Utils.IsDomain(dAddr))
{
context.ProtectDomainList.Add(dAddr);
}
return nodeValidatorResult; return nodeValidatorResult;
} }