Factor out the websocket protocol stuff into its own header file

and include this in websocket_demo.c

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Make the information update frequency a per client property

The demo html page now sends a number (the number of seconds between
updates) rather than a string. This number is now stored in the clients
data structure as update_freq and a new time_rem variable is also added
to the structure. This is initially set to the same value as
update_freq.

The timer now runs every second and looks through the active clients
decrementing the time_rem variable, when that hits 0 it sends the data
and resets the time_rem variable back to update_freq.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Use %lu in decode_frame() to print the processed variable

%ld is for a signed long int, processed is a size_t which is unsigned.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
In do_response() limit the amount we read in for the hostname

Limit the amount we can read in from /etc/hostname to 4095
(BUF_SIZE - 1). This will avoid any possible buffer overflows.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Fix the file name in the comment header of websocket_demo.c

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>