首页 > 解决方案 > Laravel 回显服务器无法启动

问题描述

Laravel 回显服务器failed在我的服务器上不断返回状态

代码

laravel-echo-server.json

{
    "authHost": "http://example.com",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "311dr094tf98745ce",
            "key": "fa43bffb3rth63f5ac9c386916ae28e6"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {},
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": false,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "secureOptions": 67108864,
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "subscribers": {
        "http": true,
        "redis": true
    },
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "http://localhost:80",
        "allowMethods": "GET, POST",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

echo-pm2.json

{
  "name": "echo",
  "script": "laravel-echo-server.json",
  "args": "start"
}

然后我运行pm2 start echo-pm2.json并且状态是online但是当我访问我的网页时我不断得到

GET https://www.example.com:6001/socket.io/?EIO=3&transport=polling&t=NA2SNHk net::ERR_TIMED_OUT

任何想法?

标签: laravelsocket.ioechocentos7

解决方案


"authHost": "http://example.com"

我将此设置为我的本地主机的 url,不确定它是否对您有帮助


推荐阅读