> Whenever I try to get the ip of my computer with
> InetAddress, it gives my local network ip of like
> 192.168.1.101. How do I get it to give my internet
> IP address?
>
> Thanks
Read this:
http://forum.java.sun.com/thread.jspa?threadID=727490
> > Whenever I try to get the ip of my computer with
> > InetAddress, it gives my local network ip of like
> > 192.168.1.101. How do I get it to give my
> internet
> > IP address?
> >
> > Thanks
>
> Read this:
> http://forum.java.sun.com/thread.jspa?threadID=727490
Thats pretty cool. I didn't think you could do that. I guess really it is just reading the HTML source but still I didn't think it possible. Could be pretty useful.
> How do I get it to give my internet
> IP address?
You might not have one. If your router or firewall has a pulic IP address and is doing port forwarding or NAT (I'm a little fuzzy on the distinction--I think port forwarding is one way to do NAT, but don't quote me on that), as described in the thread that prom linked to, then (assuming you cotrol the router/firewall) you can forward the desired ports to 192.168.1.101 and use the router's public IP as if it were your computer's for those ports. Else you're SOL.