CS 241: HTTP Push Server Online Source


The following code implements a very basic HTTP server with server-side push. The server sits at port 5012. When a client requests a file, the server sends the file and begins to monitor the modification timestamp on the file. If the file changes, the server pushes a fresh copy to the client.

Enjoy!

Makefile

exit_codes.h
local_assert.h
print_error.h
pushy.h
read_line.h

print_error.c
push_thr_code.c
pushy.c
read_line.c

To use the push server, you must run Firefox or Netscape and connect to http://<machinename>:5012/<filename>. For my example, I used filename = test.html. Then, I ran a simple script that changed test.html. You can access test.html and the script (swap.sh).