Hi,
I'd like to create a websocket server within one of my C++ programs.
Do any standalone C++ libraries exist for creating websockets or is the only option to get the WebKit or V8 sources and extract their implementation?
Hi,
I'd like to create a websocket server within one of my C++ programs.
Do any standalone C++ libraries exist for creating websockets or is the only option to get the WebKit or V8 sources and extract their implementation?
Maybe using or digging in the code of CPPCMS might help?
Or you could check boost::asio.
edit> In fact boost::asio alone isn't enough but you could use cpp-netlib that is based on asio and is meant to be proposed to be in boost as boost::network.
If you are specifically wanting to make a WebSockets server (as opposed to a client), then noVNC (a HTML5 VNC client) contains a C (and python) utility named wsproxy which is a WebSockets to generic TCP proxy. You could convert the WebSockets half to C++ pretty easily (or just build websocket.c into a static library and use it in a C++ server).
WebSockets is pretty easy to implement in a language that has plain socket libraries already. It's just a special handshake to begin and '\x00...\xff' framing of each packet.
Disclaimer: I made noVNC and wsproxy.