I ask because in the project (Angular JS + Laravel) you need to implement chat - I would really like to use socket.io, but, as far as I know, I cannot do without node.js, but I would like without it. I avoid the node because I have gained it and am very afraid of its falls. Advise something for this bunch?
Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants of D-side , user194374, cheops , pavel , aleksandr barakin 1 Aug '16 at 7:38 .
The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .
1 answer
Do you really want to use the COMET model?
It's just COMET - usually they call the model of a Web application, in which a request is sent to the server and stored in it for a long time, until a timer is triggered or an event occurs on the server. Initially, the term “Comet” (introduced in 2006 by Alex Russell) referred to HTTP Streaming and HTTP Polling.
Model Comet in 2016 lost its position. Now writing complex code on the client and server side, transferring extra data looks like a bicycle. Websockets is supported in all browsers and is standardized. Among its advantages: minimal delays, a decrease in the amount of used traffic and two-way connections.
Implementing a chat on Websockets will be very easy and convenient. To implement a server in PHP, I suggest you Workerman , a very convenient library for implementing various protocols and convenient monitoring of clients. Although in fact, you can use absolutely any server, it is enough to type websockets in the search on github and select the PHP language.
If you implement Comet, then no library is needed, it is enough for you to actually have a script that, working in a constant loop, will end at a certain time or issue an event upon its occurrence (implementation of Long Polling)