I know it is quite easy to get the client's IP and server IP from the httprequest in java. Is it possible to get the browser IP of the client at any means.
Thanks in advance
I know it is quite easy to get the client's IP and server IP from the httprequest in java. Is it possible to get the browser IP of the client at any means.
Thanks in advance
As I understand correctly
You can get client IP with method
HttpServletRequest httpRequest = (HttpServletRequest) request;
String userIpAddress = httpRequest.getHeader("X-Forwarded-For");
Full quote:
How to determine by what IP Address my website has been accessed?
Getting the server IP from request:
HttpServletRequest.getLocalAddr();
Full quote: Getting server address and application name
And getting the server ips can be done so:
Inet4Address.getLocalHost().getHostAddress()
Full quote: Getting the IP address of the current machine using Java