I have my own socket implementation that supports connection from regular tcp client. Now I would like to add websocket support in my server program. In that case I will need to support handshaking and message framing protocols that are supported by major web browsers. I was able to handle the handshaking part, but was stuck in dealing with the framing and un-framing of the messages. Is there any existing C or C++ library that handles the encoding and decoding of the websocket message frames, and supports the major websocket protocols used by the major web browsers?
Most of the current implementation that I found (i.e. libwebsocket, websocketpp, etc) implement their own server and client library, which means that I need to use their socket implementation. I don't want to do that because this will require me to modify a lot of things in my current program, and it is not an option for me. What I need is just a simple library that handles the encoding and decoding of the websocket frames (and/or also handle the handshaking part, but it is not compulsory).