Skip to content

Commit 2cbe26f

Browse files
committed
Add ipv6 support
1 parent 6817deb commit 2cbe26f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

client.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ func isPrivateIP(config Config, addr multiaddr.Multiaddr) bool {
712712
return false
713713
}
714714
config.Logger.Infof("Extracted IP: %s", ipStr)
715+
// Check for IPv6 loopback
716+
if ipStr == "::1" {
717+
return true
718+
}
719+
715720
ip := net.ParseIP(ipStr)
716721
if ip == nil || ip.To4() == nil {
717722
return false
@@ -738,10 +743,7 @@ func isPrivateIP(config Config, addr multiaddr.Multiaddr) bool {
738743
return true
739744
}
740745
}
741-
if ip.Equal(net.IPv6loopback) { // ::1
742-
config.Logger.Infof("Found IPv6 loopback: %s", ip)
743-
return true
744-
}
746+
745747
return false
746748
}
747749

0 commit comments

Comments
 (0)