Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the Actual IP Address of the Client behind Firewall, in Java

I need the IP Address/Machine Name/Mac Address of the Client in my web application for a particular usecase. Using request.getRemoteHost()/request.getRemoteAddr() I get the details of the Firewall for the Network instead of the actual client machine. I also tried accessing the request header - X-Forwarded-For, as suggested in many answers. But it is always returned as Empty. I do not have control over the Proxy Server/Firewall Server to configure it to add the header, as they are Customer controlled.

Is there any other API in Java or javascript to retrieve the original Client IP for the request.

Any help is greatly appreciated...

like image 949
Leela Addagulla Avatar asked Sep 28 '22 02:09

Leela Addagulla


1 Answers

Even if you get real IP address (for example run signed Applet or trick ActiveObject) you cannot use it - it is behind firewall and you cannot access it.

Probably your need to uniquely identify computer/browser? There are some other approaches to do so. Cookies for start.

like image 144
Marsha Avatar answered Oct 31 '22 11:10

Marsha