Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get client / user ip address? [duplicate]

Is it possible to get the ip address of the user (visitor of my website) without using server side language like PHP?

I have a problem while using the server language (PHP) because of load balancer for my server. I tried http_x_forwared_for that is also not retrieving the perfect ip address.

like image 663
RajeshKumar.K Avatar asked Nov 12 '22 06:11

RajeshKumar.K


1 Answers

Try this:

$.getJSON("http://smart-ip.net/geoip-json?callback=?", function(data){
   alert(data.host);
});
like image 118
Paul Rivera Avatar answered Nov 14 '22 21:11

Paul Rivera