MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / bindIsLoopback

Function bindIsLoopback

apps/server/cmd/zennotes-server/main.go:133–147  ·  view source on GitHub ↗
(bind string)

Source from the content-addressed store, hash-verified

131}
132
133func 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}

Callers 3

mainFunction · 0.85
logStartupBannerFunction · 0.85

Calls

no outgoing calls