Posted to tcl by kbk at Thu Jun 11 14:16:10 GMT 2009view raw

  1. package require http
  2. http::config -proxyhost 127.0.0.1 -proxyport 8080
  3. proc onFetchedURL {token} {
  4. puts "Status: [http::status $token]"
  5. puts "Data: [http::data $token]"
  6. set ::finished 1
  7. http::cleanup $token
  8. }
  9. http::geturl http://www.google.com/ -command onFetchedURL
  10. # run the event loop for a while
  11. vwait finished