WebSockets looks like an ideal way to pass data back and forth between the web client and server, the main potential stumbling block I can see here is setting the outgoing http headers from the CGI function... If anyone has done this please let me know..