support Websocket protocol for continuous response

This isn't full Websocket protocol as mochiweb doesn't have
the plumbing but it's still useful.

The endpoint will not return a pong if the client sends a ping
but if the heartbeat parameter is used the server will send pongs
at that right as a keep-alive.

If the server encounters an error it sends a Close message with
the reason before closing the socket.
1 file changed