diff --git a/easywsclient.cpp b/easywsclient.cpp index 5ef6f96..a36c89b 100644 --- a/easywsclient.cpp +++ b/easywsclient.cpp @@ -353,8 +353,8 @@ class _RealWebSocket : public easywsclient::WebSocket void close() { if(readyState == CLOSING || readyState == CLOSED) { return; } readyState = CLOSING; - uint8_t closeFrame[2] = {0x88, 0x00}; - std::vector header(closeFrame, closeFrame+2); + uint8_t closeFrame[6] = {0x88, 0x80, 0x00, 0x00, 0x00, 0x00}; // last 4 bytes are a masking key + std::vector header(closeFrame, closeFrame+6); txbuf.insert(txbuf.end(), header.begin(), header.end()); }