1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

split host port

This commit is contained in:
Zack Scholl 2020-10-05 08:19:09 -07:00
parent e145f6c61a
commit b73c0cba22

View file

@ -278,6 +278,9 @@ var PrivateIPNetworks = []net.IPNet{
} }
func IsLocalIP(ipaddress string) bool { func IsLocalIP(ipaddress string) bool {
if strings.Contains("localhost") {
return true
}
host, _, _ := net.SplitHostPort(ipaddress) host, _, _ := net.SplitHostPort(ipaddress)
ip := net.ParseIP(host) ip := net.ParseIP(host)
for _, ipNet := range PrivateIPNetworks { for _, ipNet := range PrivateIPNetworks {