Laravel-echo-server 無法監聽到佇列裡的廣播

沈益飛發表於2019-06-15

使用 Redis 監聽廣播的時候,預設使用的是 127.0.0.1:6379 地址。線上上如果 Redis 是其他伺服器地址,因此需要編輯 Redis 配置。如果不配置將監聽不到佇列。

{
        "authHost": "****", // 替換成自己的網址
        "authEndpoint": "/broadcasting/auth",
        "clients": [],
        "database": "redis",
        "databaseConfig": {
                "redis": {
                        "port": 6379,
                        "host": "***", // 替換成自己的redis host
                        "password": null
                },
                "sqlite": {
                        "databasePath": "/database/laravel-echo-server.sqlite"
                }
        },
        "devMode": false,
        "host": null,
        "port": "6001",
        "protocol": "http",
        "socketio": {},
        "sslCertPath": "",
        "sslKeyPath": "",
        "sslCertChainPath": "",
        "sslPassphrase": "",
        "apiOriginAllow": {
                "allowCors": false,
                "allowOrigin": "",
                "allowMethods": "",
                "allowHeaders": ""
        }
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章