Revert "Fix xray wireguard chained proxies not working (2dust#7113)" (#7194)
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled

This commit is contained in:
DHR60 2025-04-27 09:37:46 +08:00 committed by GitHub
parent 30f7f2c563
commit 41c406b84d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1183,7 +1183,6 @@ public class CoreConfigV2rayService
if (servers != null)
{
var domainList = new List<string>();
string? wireguardEndpointDomain = null;
if (Utils.IsDomain(node.Address))
{
domainList.Add(node.Address);
@ -1210,14 +1209,7 @@ public class CoreConfigV2rayService
&& nextNode.ConfigType != EConfigType.TUIC
&& Utils.IsDomain(nextNode.Address))
{
if (nextNode.ConfigType == EConfigType.WireGuard)
{
wireguardEndpointDomain = nextNode.Address;
}
else
{
domainList.Add(nextNode.Address);
}
domainList.Add(nextNode.Address);
}
}
if (domainList.Count > 0)
@ -1230,16 +1222,6 @@ public class CoreConfigV2rayService
};
servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer));
}
if (wireguardEndpointDomain is not null)
{
var dnsServer = new DnsServer4Ray()
{
address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress,
skipFallback = true,
domains = new() { wireguardEndpointDomain }
};
servers.AsArray().Insert(0, JsonUtils.SerializeToNode(dnsServer));
}
}
return await Task.FromResult(0);
}