diff --git a/lib/fuckwebsockets.php b/lib/fuckwebsockets.php index 66f47e5..cb5b306 100644 --- a/lib/fuckwebsockets.php +++ b/lib/fuckwebsockets.php @@ -393,7 +393,8 @@ class fuckwebsockets{ if($masked){ // get mask and message payload - $this->socket_recv($this->client, $frame_data, $messagelength + 4, MSG_WAITALL); + $messagelength += 4; + $this->socket_recv($this->client, $frame_data, $messagelength, MSG_WAITALL); for($i=4; $i<$messagelength; $i++){