diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 6bf6ba444..2a477b897 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -237,10 +237,11 @@ type OutboundDetourConfig struct { func requiresTransportSecurity(address *Address) bool { if address == nil || address.Address == nil { - return false + return true } if address.Family().IsIP() { - return !geodata.GetPrivateIPMatcher().Match(address.IP()) + ip := address.IP() + return !ip.IsPrivate() && !ip.IsLoopback() && !ip.IsLinkLocalUnicast() } domain := strings.TrimSuffix(strings.ToLower(address.Domain()), ".") return !geodata.GetPrivateDomainMatcher().MatchAny(domain)