-
Notifications
You must be signed in to change notification settings - Fork 658
laravel echo not reconnect after fail #69
Comments
It may be worth while if you actually provided some output and/or input since "my code" is the default copy/paste. Regardless, pretty sure Echo does reconnect automatically by default - it attempts every couple of seconds, but falls back to Pusher if no connection can be made. Add |
According to the docs the But yes, @svn292 please add some more info. This is how the docs says you should do it and works for a lot of people so we need a bit more context or error output. |
@stayallive You're correct, See Issue #19 (Laravel Echo will still connect to Pusher as fallback). Echo will reconnect on a potential different transport if a connection fails. I suspect this is what's happening because Echo does reconnect, but again it's pretty difficult to identify issues without anything to go on. |
its working |
Hi all found great solution ;)
window.Echo.connector.pusher.connection.bind('state_change', function(states) {
if(states.current === 'disconnected') {
window.Echo.connector.pusher.connect();
}
}); |
Uh oh!
There was an error while loading. Please reload this page.
laravel echo not reconnect after fail
here is my code
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.hostname,
wsPort: 6001,
disableStats: true,
});
The text was updated successfully, but these errors were encountered: