diff --git a/main.go b/main.go index 2ef667c..ce61e4f 100644 --- a/main.go +++ b/main.go @@ -47,7 +47,10 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { return } - host := r.Header.Get("X-Real-IP") + host := r.Header.Get("CF-Connecting-IP") + if host == "" { + host = r.Header.Get("X-Real-IP") + } if host == "" { host = r.Header.Get("X-Forwarded-For") }