laravel-echo-server icon indicating copy to clipboard operation
laravel-echo-server copied to clipboard

Redis keyPrefix does not work

Open violarium opened this issue 3 years ago • 1 comments

Redis prefix does nothing

laravel-echo-server version: 1.6.2

laravel-echo-server.json:

{
	"authHost": "http://localhost:8087",
	"authEndpoint": "/broadcasting/auth",
	"clients": [
	],
	"database": "redis",
	"databaseConfig": {
		"redis": {
			"port": "16378",
			"host": "localhost",
			"keyPrefix": "my-redis-prefix"
		},
		"sqlite": {
			"databasePath": "/database/laravel-echo-server.sqlite"
		}
	},
	"devMode": true,
	"host": null,
	"port": "6001",
	"protocol": "http",
	"socketio": {},
	"secureOptions": 67108864,
	"sslCertPath": "",
	"sslKeyPath": "",
	"sslCertChainPath": "",
	"sslPassphrase": "",
	"subscribers": {
		"http": true,
		"redis": true
	},
	"apiOriginAllow": {
		"allowCors": false,
		"allowOrigin": "",
		"allowMethods": "",
		"allowHeaders": ""
	}
}

Events still are: Снимок экрана от 2021-03-09 14-14-10

violarium avatar Mar 09 '21 11:03 violarium

Hi, if you are still having the issue I can help because I had the same problem. IMHO This depends on the Laravel configuration.

If don't have a Redis prefix isn't an issue for you, try to insert this in your Laravel .env file:

#leave REDIS_PREFIX empty but present or the laravel-echo client won't work
REDIS_PREFIX=

I removed the prefix because laravel-echo-client creates a channel string putting the prefix in the wrong place. This causes a mismatch between the channel name used by the client and the one used by the server.

ManuDoni avatar Apr 14 '21 08:04 ManuDoni