Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

m.alinasab's avatar

How to connect to Laravel Reverb without using Echo?

hello.

I have installed Laravel Reverb and I receive events in RealTime using Livewire. Now I want to do the same thing without using Laravel Echo, but unfortunately I didn't succeed. I used Postman and used the following path for the address: I used laravel-reverb.test and did not set anything else in the Header.

I ran Laravel Reverb using the following command: php artisan reverb:start --host="0.0.0.0" --port=8080 --hostname="laravel-reverb.test"

Please guide me how can I use it?

0 likes
3 replies
rzwinge's avatar

Hello, I'm also interested into this topic. I wanted to use Laravel as backend for my native apps. But documentation is lacking on, how the raw WebSocket can be used or the Pusher Protocol? Every tutorial is only showing the use of EchoJs. Perhaps someone tried this already out? Thx :)

1 like
sud0er's avatar

try to open the page and grab initiated ws url and put on postman

xanobius's avatar

Played around with this today, too, and finally found a way.

Laravel reverb uses the pusher protocol, so one would think that an inclusion of the library in the frontend would be enough. Pusher however needs the cluster attribute on initialization, we however want to connect to our own server.

With the newest versions of pusher, this is no longer possible (at least I didn't found a workaround by now), because cluster is mandatory. In older version, eg. 7.4, you can override the cluster attribute by wsHost and wsPort (and, of course wssHost and wssPort on production).

const pusher = new Pusher("[REVERB_APP_KEY]", {
      "wsHost": '[REVERB_HOST]',
      "wsPort": '[REVERB_PORT]',
      "forceTLS": false,
    })

The channels can be attached as written in Laravel, but the you're gonna listen to must be listed as the complete classname with namespace, since echo does not do the work there for you.

const channel = pusher.subscribe('your.channel');
channel.bind(`App\\Events\\YourEvent`, (data) => {})

Hope that helps, should it be still relevant ;-)

Please or to participate in this conversation.