Laravel回声服务器无法启动

时间:2020-06-05 03:11:41

标签: laravel socket.io echo centos7

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

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

已解决

问题是我的实际地址在https上运行时,我的URL设置为http (GET https://www.example.com 3}})

这样额外的S ...:)