Skip to content

Commit

Permalink
laravel-chat: fix(ChatClient): removed PingResponder, because it lead…
Browse files Browse the repository at this point in the history
…s to an infinite loop (server responds with the message Object generated from the message)
  • Loading branch information
jonasfroeller committed Jun 11, 2024
1 parent bf2c1cf commit f3dec90
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions laravel-chat/app/Livewire/ChatClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public function connectToWebSocket()
$wsUri = "ws://localhost:6969/chat/{$monitorId}?auth={$this->token}";
$this->websocket = new WebSocketClient($wsUri);

$this->websocket
$this->websocket // TODO: implement ping - ping every 2 or 3 seconds
->addMiddleware(new WebSocketMiddleware\CloseHandler())
->addMiddleware(new WebSocketMiddleware\PingResponder())
->onText(function (WebSocketClient $client, WebSocketConnection $connection, WebSocketMessage $message) {
$this->output.= "<span class='text-right'>{$message->getContent()}</span>";
})
Expand Down

0 comments on commit f3dec90

Please sign in to comment.