Wafe and W3C's Libwww

Required Functionality

W3C Reference Library Architecture

A typical application's structure with Wafe and W3


Network operations with requests and anchors

Example: Simple Download

The following example performs a simple download:

#!/usr/bin/X11/mofe --f





w3LoadAnchor [w3GetAnchor http://mohegan.wi-inf.uni-essen.de/] \


             [w3RequestNew wwwPresent {Presenter {xedit %s}}]

Example: Incremental Download

This example transfers a large file and prints information including number of bytes read so far every time a new chunk of data arrives:

#!/usr/bin/X11/mofe --f





w3AddConverter image/gif \


             {FileWriter {puts "%r: [w3RequestGet %r bytesRead] Bytes to %d"}}


w3LoadAnchor [w3GetAnchor http://wwwi.wu-wien.ac.at/buchcover.gif] \


             [w3RequestNew postCb {puts Done}]

Example: Secure HTTP (SHTTP, HTTP over SSL)

The following example demonstrates, how to access SHTTP in Wafe.

#!/usr/bin/X11/mofe --f





set W3SSL $env(HOME)/.cineast/ssl


set req [w3RequestNew \ 


         wwwPresent     {Presenter {xedit %s}} \ 


         sslPrivateKey  $W3SSL/priv/seen.pem \ 


         sslCertFile    $W3SSL/priv/seen.pem \


         sslVerifyDir   $W3SSL/certs/ \


         sslVerify      peer]


w3LoadAnchor [w3GetAnchor https://www.eunet.co.at/] $req


prev index next