ahoi's avatar
Level 5

Install and laravel-echo-server multiple times on the same server

Hello everybody,

I am using Laravel Echo Server for a real-time-notification of my users.

As I got a staging-system on the same server as my live-system, I'd like to install (and run) the echo-server twice.

Is that possible?

0 likes
3 replies
D9705996's avatar

You should be able to run more than one instance of echo server on a single server as long as you configure different TCP ports and either separate redis instances or a separate database in your redis config. You should then only need to configure your javascript that creates you echo connection to point to the correct port.

Admittedly I haven't tried this but should work. I would strongly suggest checking out laravel websockets as it has multi tenancy built in so you wouldn't need seperate socket server instances

https://docs.beyondco.de/laravel-websockets/1.0/basic-usage/pusher.html#pusher-configuration

1 like
ahoi's avatar
Level 5

Hi and thank you for your response.

I just had a look at laravel-websockets. Is it correct that I still have to register at pusher.com (because the example uses PUSHER_APP_KEY etc.)?

D9705996's avatar
D9705996
Best Answer
Level 51

@AHOI - No. You dont need to use pusher it's just pusher compatible... from the blog link in the docs

It completely replaces the need for a service like Pusher or a JavaScript-based laravel-echo-server.

However I had some issues when setting the env variables using random values so have a pusher account that I used just to generate them for me but isn't used for broadcasting

1 like

Please or to participate in this conversation.