diff --git a/src/WebSocketConnection.php b/src/WebSocketConnection.php index 28e17df..c58af01 100644 --- a/src/WebSocketConnection.php +++ b/src/WebSocketConnection.php @@ -68,6 +68,9 @@ function (Frame $frame) { $this->messageBuffer = $mb; $stream->on('data', [$mb, 'onData']); + $stream->on('close', function () { + $this->emit('close', [1006, $this, '']); + }); } public function send($data)