Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with pusher, again #17

Open
horaceho opened this issue Feb 14, 2020 · 4 comments
Open

Issue with pusher, again #17

horaceho opened this issue Feb 14, 2020 · 4 comments

Comments

@horaceho
Copy link

I follow the above instruction horaceho@0e99f41 and re-run the demo.

Pusher is connected:

Screen 2020-02-14 at 10 52 18

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:

Screen 2020-02-14 at 10 54 01

or remote window:

Screen 2020-02-14 at 10 54 03

Any suggestion?

Originally posted by @horaceho in #15 (comment)

@williambeeler
Copy link

I'm also having this problem. I had it with another attempt at a chat system with Laravel/pusher as well.

@byronCoetzee
Copy link

same issue for me - using laravel 7 and php server 7.4.4

@micos7
Copy link

micos7 commented Jun 27, 2020

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'],
});

I`m using https://github.com/beyondcode/laravel-websockets

@cvlug
Copy link

cvlug commented Aug 20, 2021

The same problem here:
followed the instructions of horaceho/chat-demo@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?

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

No branches or pull requests

5 participants