【问题标题】:Laravel echo server won't startLaravel 回显服务器无法启动
【发布时间】:2020-06-05 03:11:41
【问题描述】:

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

有什么想法吗?

【问题讨论】:

    标签: laravel socket.io echo centos7


    【解决方案1】:
    "authHost": "http://example.com"
    

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

    【讨论】:

      【解决方案2】:

      已解决

      问题是我的 url 设置为 https (GET https://www.example.com) 而我的实际地址在 http 上运行 (GET http://www.example.com)

      所以额外的S... :)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-03-28
        • 2019-07-20
        • 2011-08-05
        • 2016-02-14
        • 2013-12-08
        • 2015-08-15
        • 2021-07-08
        • 2013-06-05
        相关资源
        最近更新 更多