My server receives requests from Internet Explorer. And my server is a java web application and it is Websphere 8.5. I tried HttpRequestServlet.getRemoteAddr(), this was the IP of L4, not real client IP. I found that I could get the real IP from headers like X-Forwarded-For etc. In IE and Websphere, From which header can I get the real IP? or how can I get the real IP?
Asked
Active
Viewed 124 times
0
-
Check this out :- [https://stackoverflow.com/questions/4678797/how-do-i-get-the-remote-address-of-a-client-in-servlet] – Ankur Saxena Oct 22 '22 at 11:24
-
If your load balancer is really operating at layer 4, you'll need to see what options your load balancer has for preserving the real client IP in the connection. It can't be solved with HTTP headers in a layer 4 load balancer. – covener Oct 22 '22 at 12:29
-
Thank you all, I'm gonna try tomorrow at my work. – root Oct 23 '22 at 08:51
-
@covener Thank you, It was becuase of L4 setting. I solved it – root Oct 24 '22 at 12:16
1 Answers
0
Now X-forwarded for IHS and Websphere version not require
So you should used layer 4 with load balance is HAProxy
with open source or F5
with load balance with money
and you can used nginx
or apache
for get IP for real IP X-Forwarded
Thanks and regards
tandn

Richbest
- 151
- 10