Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Subcription to private channel with Pusher and Echo #555

Open
remif25 opened this issue Jan 3, 2021 · 1 comment
Open

Subcription to private channel with Pusher and Echo #555

remif25 opened this issue Jan 3, 2021 · 1 comment

Comments

@remif25
Copy link

remif25 commented Jan 3, 2021

Hi,

I am not sur if it's a bug or a misundestanding from myself but I got trouble to listen event on a private channel wih Echo because it was not clear how i should use Echo.
In the code above only the second is trigger when I send a event from Pusher. Is it normal ? Did I miss something ? Why others doesn't work ?

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: process.env.MIX_PUSHER_APP_KEY,
    cluster: process.env.MIX_PUSHER_APP_CLUSTER,
    forceTLS: true,
});

const channel = window.Echo.private('App.Room.1');

window.Echo.private('App.Room.1')
    .listen('new-message', function(e) {
        console.log("1");
});
window.Echo.listen('private-App.Room.1', '.new-message', (e) => {
    console.log("2");
});
channel.listen('new-message',function(e) {
    console.log("3");
});
channel.listen('private-App.Room.1', '.new-message', (e) => {
    console.log("4");
});

Tell me if you need more informations.
Thank you.

@rennokki
Copy link

rennokki commented Nov 7, 2021

This package seems to be abandoned. I have initially forked the app, but I found out how inefficient is Socket.IO, and managed to create an open-source Pusher alternative (that doesn't require Pusher credentials) that can be deployed anywhere for free. This does require the driver to be switched from Socket.IO to Pusher. Not sure if it helps, but I wanted to spread the word about it. 😁 Read more about it here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants