Skip to content

Commit

Permalink
Merge pull request #62 from ratchetphp/mask-close
Browse files Browse the repository at this point in the history
Mask the close frame
  • Loading branch information
cboden committed Oct 22, 2017
2 parents a53f6c5 + cd15012 commit f8df4bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/WebSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f8df4bc

Please sign in to comment.