Getting a public IP address when connected to a router

Kee Nethery kee at kagi.com
Tue Dec 14 00:06:07 EST 2010


I agree with Sarah and to explain why ...

When your computer is inside a firewall or gateway or router that does Network Address Translation (NAT  http://en.wikipedia.org/wiki/Network_address_translation) there is no way to know what your external address is because all your computer knows is it's internal address and the internal address of the gateway that is connected to the outside world.  You have to talk to a machine outside your private network and ask it what it sees as your IP address. There are a bunch of web sites that will tell you the external address for your computer. You'll need to parse the HTML that comes back to you. Sarah provided one web site that I'm sure works fine, there are tons of others. A search for "my ip address?" will give you lots of web sites that can display your real external IP address.

If your software really needs to know the external IP address and you do not want to rely upon web sites created by others that you have to parse, you can build your own web site and hit it. That way you can be sure that the web page always gives you back the data in a format you can parse. Otherwise, when your chosen external web site alters its HTML response, your code will break.

Kee Nethery


On Dec 13, 2010, at 8:07 PM, Terry Judd wrote:

> Does anyone have a LC routine (or tips on how to write one) that will enable
> me to get a public IP address rather than the local one assigned by a
> router?
> 
> Terry...
> 
> --
> Dr Terry Judd | Senior Lecturer in Medical Education
> Medical Education Unit
> Melbourne Medical School
> The University of Melbourne
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




-------------------------------------------------
I check email roughly 2 to 3 times per day. 
Kagi main office: +1 (510) 550-1336







More information about the Use-livecode mailing list