【发布时间】:2018-06-17 15:10:16
【问题描述】:
Laravel Echo 服务器通过以下方式启动:
laravel-echo-server start 并且运行良好:
L A R A V E L E C H O S E R V E R
version 1.3.1
Starting server...
✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
✔ Listening for redis events...
Server ready!
CHANNEL private-user:09222583-ef73-5640-bcc8-062b36c4f380.d3d0a4d2-0c95-5f5f-aea4-1dfe1fa36483
但是,在前端,轮询似乎失败了。网络选项卡显示请求不断尝试连接并失败:
网址如下所示:
https://example.com:6001/socket.io/?EIO=3&transport=polling&t=MGEIXhf
laravel-echo-server.json 看起来像这样:
{
"authHost": "https://example.com",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {
"host": "127.0.0.1",
"password": "56df4h5dfg4"
}
},
"devMode": false,
"host": null,
"port": "6001",
"protocol": "https",
"socketio": {},
"sslCertPath": "/etc/nginx/ssl/example_com/ssl-bundle.crt",
"sslKeyPath": "/etc/nginx/ssl/example_com/example_com.key",
"sslCertChainPath": "",
"sslPassphrase": ""
}
6001 的端口似乎在ufw 中打开:
Status: active
To Action From
-- ------ ----
...
6001 ALLOW Anywhere
...
6001 (v6) ALLOW Anywhere (v6)
...
【问题讨论】:
-
你成功了吗?
标签: laravel sockets socket.io laravel-echo