G Web Server Examples

CGI Animation

During a server-push animation, an HTTP server sends the browser one animation frame at a time.

The G Web Server has built in support for generating server-push animations from the output of a CGI. The animation is invoked through the .spool URL. The URL specifies which CGI is used for generating the individual images. The server then repeatedly calls the CGI and sends its output to the browser.

In this example, the CGI simply returns the contents of GIF files inside its directory. The CGI uses a cookie to keep track of which frame should be returned whenever its called.

The following is an embedded image of a server-push animation produced by the CGI /cgi-bin/examples/blob.vi. The CGI is called approximately twice a second for a duration of 30 seconds. The HTML code for this image is

<IMG src="/.spool?/cgi-bin/examples/animate/blob.vi&refresh=0.5&lifespan=30">

The server-push animations can currently be viewed only in Netscape Navigator.


© National Instruments