ODoH: until relay auto selection is implemented, pick random ones

This commit is contained in:
Frank Denis 2021-06-07 11:00:21 +02:00
parent 27a82c54c8
commit cd45f64c18
1 changed files with 6 additions and 0 deletions

View File

@ -301,6 +301,12 @@ func findFarthestRoute(proxy *Proxy, name string, relayStamps []stamps.ServerSta
}
server := proxy.serversInfo.registeredServers[serverIdx]
proxy.serversInfo.RUnlock()
// Fall back to random relays until the logic is implementeed for non-DNSCrypt relays
if server.stamp.Proto != stamps.StampProtoTypeDNSCrypt {
return &relayStamps[rand.Intn(len(relayStamps))]
}
serverAddrStr, _ := ExtractHostAndPort(server.stamp.ServerAddrStr, 443)
serverAddr := net.ParseIP(serverAddrStr)
if serverAddr == nil {