Answer the question
In order to leave comments, you need to log in
What is better to use for websockets: Ratchet or Socket.IO?
It is necessary to fasten real-time notifications to the application in PHP. Here, as I understand it, there are many options, I want to do it via WebSockets, but what is the best way - to use the implementation of the protocol in PHP or in Node.JS? I'm leaning towards the PHP option, because Node.JS is not installed on the server, and I want it to be uniform, i.e. using PHP. The server on nginx will not have problems with this if you use Ratchet, I looked, does it work mainly in WAMP, or not?
Answer the question
In order to leave comments, you need to log in
IMHO php shouldn't do that.
There was one bad experience with the ratchet, I did not try again.
Not updated for 7 months...
https://github.com/ratchetphp/Ratchet
You are working with a websocket through JS at the front.
The socket backend doesn't work so uniformity is just JS, not php.
Implemented the simplest
php bundle (all logic) -> send, php (elephant.io) -> to nodejs (socket.io) -> accept on the client
Initially I thought to take Ratchet, but I came to the conclusion that the node is simpler and I assume that it is more stable and lighter in memory. I myself did not write on the node before, but in a couple of days I figured it out in principle. If you are not slow-witted, then you can set everything up from scratch both on the client and on the server in a few hours from scratch.
Use what is convenient, Ratchet is fine, it has bindings to zeromq out of the box as part of react on top of which Ratchet is built, and php itself has excellent performance and an excellent garbage collector.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question