Can't start the laravel-websockets admin page

给你一囗甜甜゛ 提交于 2021-01-29 18:26:03

问题


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?


回答1:


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!)



来源:https://stackoverflow.com/questions/56444602/cant-start-the-laravel-websockets-admin-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!