|
Re: How you could get your public IP from Squeak: msg#00107lang.smalltalk.squeak.beginners
On Mon, Jun 25, 2007 at 07:36:28AM -0300, Edgar J. De Cleene wrote: > My router is NOGA KN-S1060 > > | stream wanIp | > stream := HTTPSocket > httpGet: 'http://192.168.1.1/sys_status.htm' > args: nil > user: 'admin' > passwd: 'admin'. > stream upToAll: 'wanIP'. > wanIp := stream upTo: $;. > ^ wanIp := (wanIp findTokens: '"') at: 2 > > And I have a Mac , a Windows PC and a Linux box on my small LAN > > Perhaps this could be useful to some Here is a variation that uses the public service dyndns: getPublicIP | stream | stream := HTTPSocket httpGet: 'http://checkip.dyndns.com'. stream upToAll: 'IP Address: '. ^ stream upTo: $< That page is tiny, and so is pretty quick to download and parse. -- Matthew Fulmer -- http://mtfulmer.wordpress.com/ Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: SampleCode-ImageViewer, Edgar J. De Cleene |
|---|---|
| Next by Date: | Re: How you could get your public IP from Squeak, Edgar J. De Cleene |
| Previous by Thread: | How you could get your public IP from Squeak, Edgar J. De Cleene |
| Next by Thread: | Re: How you could get your public IP from Squeak, Edgar J. De Cleene |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |