Internet communication through a Firewall

Klaus Major klaus at major-k.de
Sun Sep 26 13:51:21 EDT 2004


Buenos dias Alejandro,

> ...
> So it's possible, that Metacard uses this port
> to download the stack tools.metacard.com
>
> I had to look the scripts of the MC IDE but this
> has always look to me as Brain surgery with the
> patient wake up (by the way, i've read somewhere
> that THIS is possible, maybe in Scientific American
> or somewhere else... Ahrgg!!)
>
> Could Richard or Wilhem or Klaus put in a new
> message the script that MC IDE uses to call the
> stack "tools.metacard.com" from the internet?

well, it's a simple "load url..." thing... :-)

Here is the script of stack "download stack" which loads
"tool.metacard.com" and all other stacks in the menus of the IDE...

It gets called from the menus wiht:

...
put "the complete url to the stack..." into href
send "downloadNgo href" to stack "download stack"
...

#######
local stime, cancelled

on mouseUp
   if the short name of the target is "Cancel"
   then put true into cancelled
end mouseUp

on updateme href
   local stat, nk
   if cancelled then
     unload url href
     close me
     exit to MetaCard
   end if
   put urlStatus(href) into stat
   if stat contains "error" or stat contains "not found" then
     close me
     answer "Error downloading URL" && href  & cr \
         & "Check network connection and proxy setup in Preferences."
     unload url href
     exit to MetaCard
   end if
   if stat contains "cached" then
     put "Done" into field "progress"
     set the thumbpos of sb 1 to the endValue of sb 1
     wait 500 milliseconds
     close me
     if word 1 of url href is "#!/bin/sh"
     then go url href
     else answer "URL" && href  && "is not a stack."
     unload url href
     exit to MetaCard
   end if
   if item 1 of stat is "loading" then
     put item 2 of stat div 1024 into nk
     put nk & "K/" & item 3 of stat div 1024 & "K  "\
         & nk * 10 div (the long seconds - stime) / 10 & "K/sec" into 
field "progress"
     set the endValue of sb 1 to item 3 of stat
     set the thumbpos of sb 1 to item 2 of stat
   end if
   send "updateme" && quote & href & quote to me in 500 milliseconds
end updateme

on preOpenStack
   local fwidth
   put the formattedWidth of field "url" into fwidth
   set the width of field "url" to fwidth
   set the width of sb 1 to fwidth - 16
   set the width of me to the right of field "url" + 8
end preOpenStack

on downloadNgo href
   put false into cancelled
   load href
   ###!!!!
   put "Loading url" && href  into field "url"
   put empty into field "progress"
   set the thumbPos of sb 1 to 0
   send "updateme" && quote & href & quote to me in 1 second
   put the long seconds into stime
   modal me
end downloadNgo
##########

Hope that helps...


Best from germany

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the metacard mailing list