mirror of
https://github.com/mpolden/echoip.git
synced 2025-01-13 03:37:21 +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 (r *DefaultOracle) IsLookupPortEnabled() bool { return r.lookupPortEnabled }
|
||||||
|
|
||||||
func lookupPort(ip net.IP, port uint64) error {
|
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)
|
conn, err := net.DialTimeout("tcp", address, 2*time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user