Distinguish IP from port

In case IP is an IPv6 address.
This commit is contained in:
Martin Polden 2016-04-17 15:23:38 +02:00
parent 9d8a541caf
commit 270ffec441

View File

@ -95,7 +95,7 @@ func (r *DefaultOracle) IsLookupCityEnabled() bool { return r.lookupCityEnabl
func (r *DefaultOracle) IsLookupPortEnabled() bool { return r.lookupPortEnabled }
func lookupPort(ip net.IP, port uint64) error {
address := fmt.Sprintf("%s:%d", ip, port)
address := fmt.Sprintf("[%s]:%d", ip, port)
conn, err := net.DialTimeout("tcp", address, 2*time.Second)
if err != nil {
return err