Reputation: 307
I have the demo laravel websockets app up and running on a centos server, having followed the basic installation instructions here: https://github.com/beyondcode/laravel-websockets-demo
I've also got it set up and running in Nginx (so am not running php artisan serve)
However, I can't get the php artisan websockets:serve
command to work. on the cli it says:
"Starting the WebSocket server on port 6001..."
And I can get into mydomain/laravel-websockets
and see the admin console, but it can't connect - instead I get a
"Channels current state is unavailable" error.
If I do the exact same steps on my local machine, without going through Nginx, the websocket connecting works fine.
I can't find any reference to the laravel-websockets package error logging or where I might find it.. there are no errors being logged in app/storage/logs
.
Does anyone have any ideas?
Upvotes: 0
Views: 5432
Reputation: 307
It turned out to be that I needed to open port 6001 in the EC2 console.
Once I did this I could see:
Starting the WebSocket server on port 6001... New connection opened for app key someKey. Connection id 531095113.417906678 sending message {"event":"pusher:connection_established","data":"{\"socket_id\":\"531095113.417906678\",\"activity_timeout\":30}"} someKey: connection id 531095113.417906678 received message: {"event":"pusher:subscribe","data":{"auth":"someKey:6ed67f163e2eee2460fb0fbc8ce33f7b6a8e4080a535d4a101bbe9b15a1b29d6","channel":"private-websockets-dashboard-subscribed"}}.
And the laravel websockets dashboard could connect.
So Simple (when you know!)
Upvotes: 1