mirror of https://github.com/schollz/croc.git
split host port
This commit is contained in:
parent
e145f6c61a
commit
b73c0cba22
|
@ -278,6 +278,9 @@ var PrivateIPNetworks = []net.IPNet{
|
|||
}
|
||||
|
||||
func IsLocalIP(ipaddress string) bool {
|
||||
if strings.Contains("localhost") {
|
||||
return true
|
||||
}
|
||||
host, _, _ := net.SplitHostPort(ipaddress)
|
||||
ip := net.ParseIP(host)
|
||||
for _, ipNet := range PrivateIPNetworks {
|
||||
|
|
Loading…
Reference in New Issue