diff --git a/server/main.go b/server/main.go index 55f6234..89f4da4 100644 --- a/server/main.go +++ b/server/main.go @@ -270,6 +270,9 @@ func completion(w http.ResponseWriter, req *http.Request) { // where I do the IP rate limiting userKey := req.RemoteAddr + if req.Header.Get("X-Forwarded-For") != "" { + userKey = req.Header.Get("X-Forwarded-For") + } createdTime, ok := ipAddyTenFree[userKey] if !ok { ipAddyTenFree[userKey] = currentTime()