From f3dec90daffaac06508585730ee2cfc25d5a8a68 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 11 Jun 2024 09:54:05 +0200 Subject: [PATCH] laravel-chat: fix(ChatClient): removed PingResponder, because it leads to an infinite loop (server responds with the message Object generated from the message) --- laravel-chat/app/Livewire/ChatClient.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/laravel-chat/app/Livewire/ChatClient.php b/laravel-chat/app/Livewire/ChatClient.php index 890b722..16b6d28 100644 --- a/laravel-chat/app/Livewire/ChatClient.php +++ b/laravel-chat/app/Livewire/ChatClient.php @@ -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.= "{$message->getContent()}"; })