From 2caec729fce187fb157bad1735f4836283a207b7 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sat, 21 Mar 2026 11:59:52 +0000 Subject: [PATCH] Protect xhttp split address (#8970) --- .../Handler/Builder/CoreConfigContextBuilder.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs index ddc98a1f..a8cca654 100644 --- a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs +++ b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs @@ -322,6 +322,7 @@ public class CoreConfigContextBuilder context.ProtectDomainList.Add(address); } + // ech query server name protect if (!node.EchConfigList.IsNullOrEmpty()) { 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; }