Open horaceho opened 4 years ago
I'm also having this problem. I had it with another attempt at a chat system with Laravel/pusher as well.
same issue for me - using laravel 7 and php server 7.4.4
Got it to work - in the enablePusher function I use
window.Echo.private(`mc-chat-conversation.${this.conversation}`)
.listen(".Musonza\\Chat\\Eventing\\MessageWasSent", (e) => {
console.log(e)
this.messages.data.push(e.message);
})
Or you could use broadcastAs() function on the events in the Eventing folder and name them as you like. Dont forget the dot.
Echo config in bootstrap.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
wsHost: window.location.hostname,
wssHost: window.location.hostname,
wsPort: 6001,
wssPort: 6001,
encrypted: false,
enabledTransports: ['ws','wss'],
});
The same problem here: followed the instructions of horaceho@0e99f41 and re-run the demo Messages are succesfully send to pusher.com. However, new message only shows up after manual refresh page. The fix of micos7 does not solve the problem, but causes this error: "VM401:1 POST http://127.0.0.1:8000/broadcasting/auth 403 (Forbidden)"
How to make the demo work?
I follow the above instruction https://github.com/horaceho/chat-demo/commit/0e99f41c5fef792d905506feffe0d5243c12bfb6 and re-run the demo.
Pusher is connected:
However, new message only shows up after manual refresh page (pressing Cmd-R, 1 & 2 are shown), the new message (e.g. enter 3 and click Send) does not show up in own window:
or remote window:
Any suggestion?
Originally posted by @horaceho in https://github.com/musonza/chat-demo/issues/15#issuecomment-586076233