Is there any way that I could get the original IP address of the client coming to the server? I can use request.getRemoteAddr(), but I always seem to get the IP
request.getRemoteAddr()
String ipAddress = request.getHeader("x-forwarded-for"); if (ipAddress == null) { ipAddress = request.getHeader("X_FORWARDED_FOR"); if (ipAddress == null){ ipAddress = request.getRemoteAddr(); } }