Public ip address

Alex Tweedly alex at tweedly.net
Sun Jul 25 16:16:22 EDT 2004


At 21:15 25/07/2004 +0200, Roger Amar wrote:

>Hello Alex,
>
>We have to maintain a radio stations network running our automation 
>software,MacBroadcast*, via Timbuktu. To take the control of a distant 
>computer, PC or Macintosh, we have to know the public IP address to 
>connect to that computer and do our job. Since the IP address provided by 
>the ISP is not permanent, I want to write a simple code which once an 
>hour, is able to send us the actual IP public address of every radio 
>station. (Some of them have a fixed IP Address which never change but the 
>cost of this solution is about 20 $ per month.)
>Using solutions like DynDNS which is supposed to translate the IP address 
>to a fixed one is not a secure solution.
>I want to do what www.whatismyip.com is able to do.
>The solutions suggested by this list are just able to return the lan ip 
>address.

If the machines in question are directly connected to the ISP - i.e. they 
have a dial-up or DSL or equivalent DIRECT to the ISP without an 
intervening router (or firewall) then the UDP socket method should work.

If they are behind a router, without their own public address, then it's 
likely you wouldn't be able to connect in with Timbuktu anyway (unless the 
router is set up for port-forwarding).

BUT ... if you always have one machine with a static IP address, then you 
can use it to discover and save the IP address of the others.

On the dynamic-IP machine, open a socket to the static one, and send a 
packet. Have a simple echo server on the static machine which simply 
replies to the request with a packet containing the host address the packet 
came from (in the socket name from "accept connections").

See the Simplechat example under user contributions - it's at the very end 
of the list.

Feel free to ask for more detail if this is unclear, either on or off list.
-- Alex.
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


More information about the use-livecode mailing list