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

Not receiving any data from echo

Open sts-ryan-holton opened this issue 4 years ago • 3 comments

Hi, I'm having trouble getting any data to come through with this package and wonder whether it's working as intended. I've got Laravel Websockets set up (the package) and have my websocket server running and can see in the console that it is receiving data, but I'm not seeing any data coming through my channel to my Nuxt JS project.

/*
** Echo config
*/
echo: {
  broadcaster: 'pusher',
  key: 'websocketkey',
  host: 'http://localhost:6001',
  plugins: [ '~/plugins/echo.js' ],
},

In my web page, I've got:

this.$echo.channel('agents')
        .listen('AgentStats', (e) => {
            console.log(e);
        });
    }

My event channel is called agents, it's on a private channel, and the event is called AgentStats, but I see no data logged in my console log.

sts-ryan-holton avatar Feb 02 '21 10:02 sts-ryan-holton

did you manage to solve it?

melvin78 avatar Mar 12 '21 16:03 melvin78

did you manage to solve it?

Use .on instead of .listen

4KDA avatar Mar 12 '21 16:03 4KDA

ok thanks. I can see your echo configuration file in nuxt is a little bit different . I that everything?. Or there is no difference between host and wsHost?

melvin78 avatar Mar 12 '21 16:03 melvin78