WebSocket codec in C++. Implements RFC6455. Robust one-class parser implementation.
Pull request Compare This branch is 4 commits behind katzarsky:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



WebSocket codec in C++. Implements only RFC6455. Robust one-class parser implementation (handshake and frames). The library does not control sockets, it works with buffers. This gives you freedom to implement your I/O whatever way you like.

WebSocket class overview

  • parseHandshake() parses initial HTTP-like handshake and populates object properties like - host, port, etc.
  • answerHandshake() returns appropriate HTTP-upgrade response.
  • makeFrame() makes TEXT,BINARY,PING,PONG frame from message-data given in buffer and writes it into output-buffer.
  • getFrame() tries to parse new frame from input-buffer (populated by the recv() socket function or similar). Returns frame type (enum: TEXT_FRAME, BINARY_FRAME, ...), if the buffer holds incomplete frame INCOMPLETE_FRAME value is returned.


  • Demo application with sockets and buffers.
  • Demo Javascript code as a HTML5 page.


MIT, see LICENSE file.