bel2125/civetweb — pull request #38 by jshelley (2014-08-21 19:16:35+00:00)
Title: Implemented initial websocket client support

This is an initial implementation of websocket client support for civetweb. Use mg_client_websocket_connect and provide it with the connection information and a data callback, it will return a valid mg_connection object for the client connection. Write to the connection using mg_websocket_write and the callback provided to mg_client_websocket_connect will be called with any data received from the server.

A few notes:
* I am open to discussing the interface, this was just a first pass at it.
* I had to create a copy the function read_websocket called read_client_websocket because I needed to comment out "//assert(conn->content_len == 0);" to get things working. I was unsure what the ramifications of commenting this out in read_websocket were so I just made a copy for the time being.
* Included an example for this feature in examples/websocket_client
* Included a small unit test for this functionality called test_mg_client_websocket_connect, although it tests the functionality against an external server, not sure if this is a problem.
* Open to all comments and suggestions!