Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IP Address

 
Prabjhot Singh
Greenhorn
Posts: 28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have website & I have been asked to find user IP address & I thought I can try to find it using Request object

but I have been advised to find it using JavaScript.

I googled and all examples sends a call to rest service (server) to find client IP address.

Is it correct assumption that using JavaScript one can find IP address of user (browser machine) or request to Server is required...

this might not be correct forum for following question... where can I post this question ... please...

regards..
 
Tim Moores
Bartender
Posts: 3135
50
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can't do this, nor do you need to call a WS for this. Check the methods available in the HttpServletRequest object, it has the IP address.
 
Hema Karthikeyan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<script type="text/javascript" src="https://l2.io/ip.js"></script>
Display Client's IP address in your HTML page using javascript
try this code
 
Prabjhot Singh
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:JavaScript can't do this, nor do you need to call a WS for this. Check the methods available in the HttpServletRequest object, it has the IP address.

thanks Tim for your reply.... I had similar in my mind..
 
Prabjhot Singh
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hema Karthikeyan wrote:<script type="text/javascript" src="https://l2.io/ip.js"></script>
Display Client's IP address in your HTML page using javascript
try this code

Hello Hema, thanks for your reply... I have refereed such URL in my original post... it's probably a rest call... JavaScript is not generating (finding) IP address... am I correct ?
 
Tim Moores
Bartender
Posts: 3135
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. This only works because the Javascript is loaded from an external server that determines the IP address of the client - something you may not want to do.
 
Prabjhot Singh
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google is impressive...

this post says in HTML5 era it's by design & not by hack or bug.

is following way valid

webpage

any suggestions please?
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Determining a client's IP address is not a reliable process. One thing that it's totally useless for, incidentally, is uniquely identifying a user for security purposes.

Every desktop machine at mousetech.com (my domain) appears to have the same public IP address. That's because they're all behind a NAT wall. They have unique internal IP addresses, but what good does knowing that my desktop machine's IP address is currently set by DHCP to 192.168.10.3? The number of other computers in the world using that internal IP address may well be in the millions.

At the moment I have a laptop set up with 2 separate NICs and therefore 2 distinct IP addresses. In case you were wondering, it's because I had to plug in a cable to get a route to places that the Wifi connector can't reach.

So, as they say, getting IP addresses is for Entertainment Purposes Only and should not form part of any serious security or identification scheme.
 
Prabjhot Singh
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Tim, I definitely has very less or no info on IP address topic, thanks for wonderful description.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic