|
Getting client IP when using proxy: msg#00177java.jetty.support
Our application (a web-based massive multiplayer game) runs JBoss 3.0.1 with Jetty 4.1.0. Recently, we added an Apache server configured as a proxy between the clients and Jetty. The problem we have now is that whenever a servlet tries to get the client's IP address through ServletRequest.getRemoteAddr() it gets the IP of the proxy. This is not a huge problem, since Apache can be configured to add a HTTP header called X-Forwarded-For with the client's IP address. Still though, we get only the proxy's IP address in the request log. My question is whether there's an alternative to ServletRequest.getRemoteAddr() that returns the IP of the actual client, or whether it would be feasible to let Jetty return the content of X-Forwarded-For (if it exists) from getRemoteAddr(). All of this without breaking the servlet spec too much of course. :-) This is kind of a philosophical question, since there are not that many calls to getRemoteAddr() in our code, so it wouldn't be a problem to change it, and as we already have our own logging class, logging the correct IP addresses in the request log isn't an issue. I guess I just had to ventilate this. :-) Martin Vilcans Developer, Jadestone Group AB http://www.jadestone.se ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get 128 Bit SSL Encryption! http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM ---------------------------------------------------------------------~-> For the latest information about Jetty, please see http://jetty.mortbay.org Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Demos do not work, Chris Haynes |
|---|---|
| Next by Date: | Re: Demos do not work, Gene Campbell |
| Previous by Thread: | Demos do not work, Gene Campbell <genecampbell8@xxxxxxxxx> |
| Next by Thread: | Bug in <listener> handling, Stephen Stevens |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |