Askedio / laravel-ratchet

A Ratchet Server built for Laravel
https://medium.com/asked-io/creating-a-ratchet-web-socket-server-with-laravel-743e3dae766f
MIT License
185 stars 47 forks source link

Beginners tutorial #25

Open Noitidart opened 6 years ago

Noitidart commented 6 years ago

Hi there,

I was hoping to use this without any 3rd party service like pusher. Pusher charges money.

Is there any beginners tutorial? This one seemed easy but I failed - https://medium.com/@adnanxteam/how-to-use-laravel-with-socket-io-e7c7565cc19d - and came to your package. But I can't find a step to step guide on how to use your package please.

gcphost commented 6 years ago

Hi @Noitidart

Ratchet itself is the socket server, it will replace the use of pusher or socket.io.

I can try to draft up a tutorial when I have some free time, in the mean time this may help.

Noitidart commented 6 years ago

Sincre thanks @gcphost ! I read your medium article and came here. I will try this steps. A guide on medium and linekd to from readm, or maybe guide in readme here would be awesome. I'm curiours about the zmq thing, I didn't do that step when I tried doing this.

Thanks so much for your help!!

Noitidart commented 6 years ago

Also is there anything a newbie like me could do to show appreciation? Does this module accept paypal?

gcphost commented 6 years ago

@Noitidart

@simonhamp wrote an article that talks a little about zmq, it might help with your development and questions. https://medium.com/@simonhamp/stuff-to-do-when-youre-not-well-e7f0102b92dd

Feel free to reach out to @simonhamp to show your appreciation, he's done quite a bit of work on this package. I only planted the seed :D

Noitidart commented 6 years ago

Thanks @gcphost I'll check it out. And major thanks to @simonhamp!

Noitidart commented 6 years ago

From a quick look at the article I think laravel-ratchet is exactly what I've been looking for. He says:

it just seemed a bit of a handful, a definite barrier to entry that would put some people off and increase the requirements of a solution beyond something ‘turn-key’.

Turn key is so what laravel has been, i was looking for websockets turn-key as well (as it was in sails.js).

tonysm commented 6 years ago

Hi there. I'm trying to run it locally, but no success in broadcasting events to the frontend. I've created a detailed issue at the pelim/laravel-zmq (see https://github.com/pelim/laravel-zmq/issues/5), but not sure where the error lies. I also have a demo application if you want to help https://github.com/tonysm/laravel-ratchet-zmq-echo.

Noitidart commented 6 years ago

I couldn't figure it out either @tonysm - I think though this is because I was on shared hosting.

pablor21 commented 5 years ago

Hey! I think I've found the solution! Just use

\ZMQ::SOCKET_PUSH and \ZMQ::SOCKET_PULL instead of \ZMQ::SOCKET_PUB and \ZMQ::SOCKET_SUB on your zmq config.

Also make sure that your zmq method is \ZMQ::SOCKET_PULL on config/ratchet.php

ahmadsyamim commented 4 years ago

For reference: https://github.com/tonysm/laravel-ratchet-zmq-echo