From f28fa31c145c56f1024881797343b439533ad013 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Thu, 23 Oct 2025 17:57:47 +0800 Subject: [PATCH 1/3] Fix tcp dns (#8179) --- .../Services/CoreConfig/V2ray/V2rayDnsService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs index d3cff6cc..7170c5f0 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs @@ -82,11 +82,16 @@ public partial class CoreConfigV2rayService var (domain, scheme, port, path) = Utils.ParseUrl(dnsAddress); var domainFinal = dnsAddress; int? portFinal = null; - if (scheme.IsNullOrEmpty() || scheme.Contains("udp", StringComparison.OrdinalIgnoreCase) || scheme.Contains("tcp", StringComparison.OrdinalIgnoreCase)) + if (scheme.IsNullOrEmpty() || scheme.StartsWith("udp", StringComparison.OrdinalIgnoreCase)) { domainFinal = domain; portFinal = port > 0 ? port : null; } + else if (scheme.StartsWith("tcp", StringComparison.OrdinalIgnoreCase)) + { + domainFinal = scheme + "://" + domain; + portFinal = port > 0 ? port : null; + } var dnsServer = new DnsServer4Ray { address = domainFinal, From 7c76308c936fd4ca7ba9d1a7afbffe20eef633f8 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Thu, 23 Oct 2025 17:58:02 +0800 Subject: [PATCH 2/3] Fix (#8180) --- .../CoreConfig/V2ray/V2rayConfigTemplateService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs index ed023126..986e1966 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs @@ -97,9 +97,12 @@ public partial class CoreConfigV2rayService continue; } } - else if (!fullConfigTemplate.ProxyDetour.IsNullOrEmpty()) + else if ((!fullConfigTemplate.ProxyDetour.IsNullOrEmpty()) + && ((outbound.streamSettings?.sockopt?.dialerProxy.IsNullOrEmpty() ?? true) == true)) { - var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address ?? outbound.settings?.vnext?.FirstOrDefault()?.address ?? string.Empty; + var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address + ?? outbound.settings?.vnext?.FirstOrDefault()?.address + ?? string.Empty; if (!Utils.IsPrivateNetwork(outboundAddress)) { outbound.streamSettings ??= new StreamSettings4Ray(); From b4c20e7b812ef5c5ff34f29def8ab4c51b655649 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 23 Oct 2025 19:03:16 +0800 Subject: [PATCH 3/3] Bug fix https://github.com/2dust/v2rayN/discussions/8168 --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index 2840fab7..8b5acff2 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1221,6 +1221,7 @@ public static class ConfigHandler CoreType = coreType, ConfigType = EConfigType.PolicyGroup, Remarks = remark, + IsSub = false }; if (!subId.IsNullOrEmpty()) {