P
P
Petr Ponomarev2017-02-09 19:57:06
Yii
Petr Ponomarev, 2017-02-09 19:57:06

Are there any manuals for creating real time chat yii2 + node js for example?

I made a chat on the site using ajax requests, but it seems like the last century, tell me how to do such a chat correctly, I tried to do it on node, but I didn’t understand how to connect it all with the yii2 application and run it on the server (

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rou1997, 2017-02-09
@Rou1997

Made a chat on the site using ajax requests, but it's kind of like the last century,

AJAX (HTTP) is a completely normal solution for chats, and if you want new posts from other participants to appear instantly, then you just need to apply long polling, no Node.js is needed, but you can also switch to the WebSocket protocol, it is better to learn it first with Node .js, then return to PHP, which also has implementations of this protocol.

V
Victor, 2017-02-10
@Levhav

You can use not only Node.js for instant message delivery, there are other ways. For example, you can try using my open source comet server . Here is an example of a chat. It will deliver messages via websockets, and there is a simple api for interacting with php and javascript. comet-server.org/doku.php/comet:cometql and comet-server.org/doku.php/comet:javascript_api
_ _ _ from the saas version of the comet server to the open source analogue.

M
Maxim Timofeev, 2017-02-10
@webinar

If not ajax - then sockets. Lots of examples, use search.
Here is an example with node:
https://www.my-yii.com/learn/view-episode/yii-2-re...
Here is with socket Ratchet:
https://github.com/joni-jones/yii2- wschat
and there are a lot of them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question