From cd150123116d158f97436592ab1509e90bf9a9d3 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 20 Oct 2017 10:25:12 -0400 Subject: [PATCH] Mask the close frame --- src/WebSocket.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WebSocket.php b/src/WebSocket.php index bf0ebc8..0e9f7f6 100644 --- a/src/WebSocket.php +++ b/src/WebSocket.php @@ -130,6 +130,7 @@ public function send($msg) { public function close($code = 1000, $reason = '') { $frame = new Frame(pack('n', $code) . $reason, true, Frame::OP_CLOSE); + $frame->maskPayload(); $this->_stream->write($frame->getContents()); $closeFn = $this->_close;