It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Getting local IP address in javascript?

Getting local IP address in javascript?

Postby Bram on Sat Feb 19, 2011 12:06 pm

Is there a way to get the visitors *local* IP-address in javascript? I mean his LAN address like 192.168.1.x, not his regular IP-address.

I found several approaches that attempt to do this, but they either give me the external (regular) IP address, or they give 127.0.0.1 which doesn't really tell me anything. I need the local network address.

Just an alert saying "your machine's local network IP is 10.0.0.139" would be great.
Bram
 
Posts: 1
Joined: Sat Feb 19, 2011 12:04 pm

Re: Getting local IP address in javascript?

Postby bardonw on Mon Apr 11, 2011 7:23 pm

Unfortunately, there is no reliable way of doing this across browsers. To know information like this could present a security threat. Still, if you are developing only for IE and you can modify the settings on the machines that this page needs to be viewed (or if the page can be run as an HTA), you could probably access this data via an ActiveXObject. At the moment, I am working on a Mac so I can't give you a definitive answer, but if I do find a way to do it locally, I will let you know.
bardonw
 
Posts: 7
Joined: Tue Feb 15, 2011 4:16 pm

Re: Getting local IP address in javascript?

Postby rajmv on Sun Jul 17, 2011 4:47 pm

Bram wrote:Is there a way to get the visitors *local* IP-address in javascript? I mean his LAN address like 192.168.1.x, not his regular IP-address.

I found several approaches that attempt to do this, but they either give me the external (regular) IP address, or they give 127.0.0.1 which doesn't really tell me anything. I need the local network address.

Just an alert saying "your machine's local network IP is 10.0.0.139" would be great.


don't think so.. the local IP address is only known to the localnet<->internet router at the browser end. Neither your server nor the browser will receive that info, iirc.
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 7 guests