Skip to content

Instantly share code, notes, and snippets.

@disksing
disksing / websocket.cpp
Created December 9, 2015 09:59
websocket on raw tcp example
#include "websocket.h"
#include "../common/string-util.h"
bool ws_handshake_assemble(byte* buf, u_int len, std::string& request, u_int& readLen)
{
if (len < 4)
return false;
//http head is end with an empty line
if ( buf[len-4] == '\r'