Giter Site home page Giter Site logo

Issue with pusher, again about chat-demo HOT 4 OPEN

musonza avatar musonza commented on August 16, 2024 4
Issue with pusher, again

from chat-demo.

Comments (4)

williambeeler avatar williambeeler commented on August 16, 2024

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

from chat-demo.

byronCoetzee avatar byronCoetzee commented on August 16, 2024

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

from chat-demo.

micos7 avatar micos7 commented on August 16, 2024

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

from chat-demo.

cvlug avatar cvlug commented on August 16, 2024

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?

from chat-demo.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.