 <p>This seems the most we can do to get the original IP address of the client</p> <pre><code>String ipAddress = request.getHeader("X-FORWARDED-FOR"); if (ipAddress == null) { ipAddress = request.getRemoteAddr(); } </code></pre>