From 270ffec4414bade2a290ecaf84cb794bb5edcea2 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sun, 17 Apr 2016 15:23:38 +0200 Subject: [PATCH] Distinguish IP from port In case IP is an IPv6 address. --- api/oracle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/oracle.go b/api/oracle.go index c923b0c..77b999e 100644 --- a/api/oracle.go +++ b/api/oracle.go @@ -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