I'm using http://jsonip.com to get the users IP address. For some users, its returning an internal and external IP as a comma separated string. I only want the external IP address. Can I assume some sort of order to the returned addresses? Is the external IP address always last? Or do I need to filter based on some criteria? For example: exclude 127.0.0.1, 192.168.., 10...*?
$.getJSON('http://jsonip.com/?callback=?', function(data){
console.log("Current IP Address: " + data.ip);
});
Sorry I never found this question until now. (I run jsonip.com)
jsonip uses the x-forwarded-for header to get the user's ip. The right-most (last) ip should be the visitor's public facing address.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With