Laravel 回显服务器无法启动

Laravel echo server won't start

Laravel echo 服务器一直在我的服务器上返回 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

有什么想法吗?

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

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

已解决

问题是我的 url 设置为 https (GET https://www.example.com) while my actual address is running on http (GET http://www.example.com)

所以额外的 S... :)