Search code examples
phplaravellaravel-echo

why does Laravel-echo-server try to connect to the wrong server?


I tried setting up a laravel-echo-server with the init command, when I try to start it with laravel-echo-server start i get this output:

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)

and so on. I don't really know why its trying to connect to 127.0.0.1, even though I stated in the config otherwise. Here is the 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": ""
    }
}

what am i doing wrong here? I wasn't able to find anyone with a similar problem (maybe because its so obvious?) but i don't really get why it doesn't try to connect to https://mydomain.test:6379 and instead connects to 127.0.0.1

thanks in advance guys, if you need any more code, let me know.


Solution

  • You're Laravel Echo installation is trying to connect to a Redis Server. You need to either install Redis and configure it or use one of the other Laravel Broadcasting Drivers

    Documentation