Azzaz
Azzaz

Reputation: 124

Laravel event not being broadcasted web laravel-websockets server

I'm working on a real-time chat application but facing some issues while working with broadcasting events using the laravel-websockets package. Things were working fine yesterday and I was receiving messages from private and public channels but I don't know why I'm not receiving messages anymore.

I have properly configured my environment variables and used the pusher driver for broadcasting and the redis connection for queue processing. I have also properly configured my WebSockets server and I'm sure about it because Laravel threw a curl exception when I misconfigured my WebSockets server. I am broadcasting events to a private channel and implemented the ShouldBroadcastNow interface to broadcast the message using the sync connection without queueing it, I'm successfully authenticated with the private channel as well. I've even tried to queue the broadcast using the ShouldBroadcast interface and ran the artisan queue:work command and the queue shows that jobs are processed.

Using all the above-mentioned setup I've tried broadcasting events on both private and public channels but the events are not being sent by the WebSocket server and there are no logs in the WebSocket server about the events that are sent using sync connection and those which are processed by the queue. The WebSocket server logs show new socket connections and channel authorization success logs but there is no sign of any event broadcasting (even for the public channels).

I'm so much confused about this because yesterday it was working fine and today when I restarted my PC it's not working anymore. Please help me, any help would be much appreciated!

Upvotes: 2

Views: 1515

Answers (1)

Priit Kukumagi
Priit Kukumagi

Reputation: 44

I updated my composer and have same problem. Rolling back to my previous version and it started to work again.

The problem seems to be with "pusher/pusher-php-server": "7.2.0".
Setting version to "pusher/pusher-php-server": "7.0.2" in composer.json file resolved the issue.

Change "pusher/pusher-php-server": "^7.0" to "pusher/pusher-php-server": "7.0.2".

Upvotes: 2

Related Questions