; httpdemo.vnm ; short demo of http server ; (A) 2010-07-27 ported to VM2 To init Make eth Ethernet Make http HTTPServer Make s String(100) Make t Stopwatch ; to generate some timing info for display counter := 0 End ; processes incoming HTTP requests To main Print "IP address ", eth:1, CR Print "http server running", CR t.Reset Forever [ http.Get(s) ; wait for a request Print "received request: ", s, CR If s.Compare("/") = 0 ; we only service requests for "/" [ counter := counter + 1 send_response ] http.Flush ; ] End ; response to root "GET /" request To send_response Print To http, "