proxy: fix IP limit handling

This commit is contained in:
Lan Tian
2020-10-27 23:09:55 +08:00
parent 0216365551
commit 06dbe57ab2

View File

@@ -39,6 +39,7 @@ func accessHandler(next http.Handler) http.Handler {
for _, allowedIP := range setting.allowedIPs {
if requestIp == allowedIP {
next.ServeHTTP(httpW, httpR)
return
}
}
@@ -99,4 +100,3 @@ func main() {
http.HandleFunc("/traceroute6", tracerouteIPv6Wrapper)
http.ListenAndServe(*listenParam, handlers.LoggingHandler(os.Stdout, accessHandler(http.DefaultServeMux)))
}