为什么Laravel-echo-server尝试连接到错误的服务器?

时间:2018-07-31 08:00:47

标签: php laravel laravel-echo

我尝试使用init命令设置laravel-echo-server,当我尝试使用laravel-echo-server start启动它时,得到以下输出:

L A R A V E L  E C H O  S E R V E R

version 1.3.8

⚠ Starting server in DEV mode...

✔  Running at localhost on port 6001
✔  Channels are ready.
✔  Listening for http events...
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

,依此类推。我真的不知道为什么它试图连接到127.0.0.1,即使我在配置中另有说明。这是laravel-echo-server.json:

{
    "authHost": "https://mydomain.test",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "myid",
            "key": "mykey"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
            "port": "6379",
            "host": "mydomain.test"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "https",
    "socketio": {},
    "sslCertPath": "/etc/ssl/crt.crt",
    "sslKeyPath": "/etc/ssl/key.key",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": false,
        "allowOrigin": "",
        "allowMethods": "",
        "allowHeaders": ""
    }
}

我在这里做错了什么?我找不到任何有类似问题的人(也许是因为它如此明显?),但我真的不明白为什么它不尝试连接到https://mydomain.test:6379而是连接到127.0.0.1

预先感谢您,如果您需要更多代码,请告诉我。

1 个答案:

答案 0 :(得分:1)

您是Laravel Echo安装正在尝试连接到Redis服务器。您需要安装Redis并进行配置,或者使用其他Laravel Broadcasting Drivers

Documentation