(bind string)
| 131 | } |
| 132 | |
| 133 | func bindIsLoopback(bind string) bool { |
| 134 | host, _, err := net.SplitHostPort(bind) |
| 135 | if err != nil { |
| 136 | host = bind |
| 137 | } |
| 138 | host = strings.Trim(host, "[]") |
| 139 | if host == "" { |
| 140 | return false |
| 141 | } |
| 142 | if strings.EqualFold(host, "localhost") { |
| 143 | return true |
| 144 | } |
| 145 | ip := net.ParseIP(host) |
| 146 | return ip != nil && ip.IsLoopback() |
| 147 | } |
no outgoing calls