A
A
Alexey Markov2017-08-15 18:55:38
Chats
Alexey Markov, 2017-08-15 18:55:38

How to send data from the client in Ratchet push?

Good day!
There is a project in laravel.

I drove in the code on the server side according to the socketo.me/docs/push manual
The client connects, the data is sent using php.

The example does not describe the publish method (for reasons I do not understand).

When connecting ab.session, I write publish to the click event for the button, then in the Pusher.php file I write a call to $this->onBlogEntry($entry) in onPublish.

The code is working, I just want to know if it's right to do everything through events, it's rather weak on this topic. Googled nothing

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Markov, 2017-08-17
@orbitroom

As a result, I took the logic from the first solution with MessageComponentInterface and sketched analogies in the WampServerInterface version. Everything seems to be smooth

A
Alexander Alexandrovich, 2017-08-15
@tatu

Try Laravel's simple Ratchet integration package https://github.com/TheOrchid/Socket

K
kwon, 2017-08-17
@kwon

Will it fit?
#2 Laravel: Ratchet - WebSocket. Doing PUSH

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question