F
F
Fluber2018-02-05 18:36:00
Laravel
Fluber, 2018-02-05 18:36:00

Laravel live chat, how best to do?

Hello. I have a question. Is it possible to implement chat on laravel without any pusher (especially since it is paid), socket.io and so on? Pure chat in php + javascript, possibly with ajax technology. I just need a messenger that will send / receive / read messages in real time in real time.
It seems like this can be done, for example on: https://kwork.ru they somehow implemented a message system only in js and php. They just send an ajax request without sockets and any nonsense. And all messages come in real time
On the Internet I found packages for laravel only with pusher, sockets and that's it. I didn't find anything out of the ordinary.
Can you help?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Aksentiev, 2018-02-05
@Sanasol

I didn't find anything out of the ordinary.

everything that is normal is classified as abnormal.
through Ajax, hammer every second at least or long poll, if you discard the normal options.

A
Antonio Solo, 2018-02-05
@solotony

you can implement it, but Laravel is heavy for chat (i.e. if you need to do a constant poll for new events / messages),
I would write a light C / C ++ program for such purposes, which would return the state and new (s ) message(s).

V
Viktor, 2018-02-06
@Levhav

Instead of a pusher, you can try using my comet server project https://github.com/CppComet/comet-server it is written in C++ and provides a fairly simple api for sending and receiving messages.
And if you want to be able to use shared hosting and not install any software on your server, then you can use the same comet server but as a service https://comet-server.com/ the SaaS version and the open source version have the same API, so you there will be no binding to the service and it will be possible to switch from the SaaS version to the open source version simply by changing the server address in the connection settings and without any changes in the code.
If you have any questions about the comet server, write to me. There are contacts in the profile. I will be happy to discuss.

A
Alex Wells, 2018-02-06
@Alex_Wells

Have you chosen ajax over sockets?
Understand the topic before calling pusher & socket.io "nonsense". These are the BEST chat solutions (not to mention even cooler solutions like firebase & socketcluster). Do you have any idea what it's like to send a request every second for one client? What if there are at least 100 customers? 100 fat sql queries every second? Why such a burden?
socket.io will support thousands of clients while loading only one core and a bit of memory.
pusher will not load anything at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question