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:
parent
e145f6c61a
commit
b73c0cba22
1 changed files with 3 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue