mirror of
https://github.com/mpolden/echoip.git
synced 2024-11-10 07:27:22 +01:00
Distinguish IP from port
In case IP is an IPv6 address.
This commit is contained in:
parent
9d8a541caf
commit
270ffec441
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user