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.
Would you (or anyone else) have any idea how to go about this?? I'm really stuck with this...
I do have the latest Sun Java installed so that shouldn't be a problem.
Unfortunately this only gives the external (regular / global) IP, which is trivial.
I need their internal, local network IP, like "10.x.x.x" or "192.168.x.x", any idea how to get that?
I just tried that code and it did NOT give the correct IP address. It told me the IP address of my internet connection and not that of my computer. That's because it is using server side code to get the IP address - SSI in that example.
if (java && java.net)
ip = ''+java.net.InetAddress.getLocalHost().getHostAddress();
else ip = 'unknown';
Alternatively, I just found out that it is possible to do it entirely with Java - as http://www.proxyblind.org/javaipp.shtml demonstrates.