Real Time Chat Module

How to create real time chat module in CakePHP 3.5 .What should be use?

Options

  1. You need node js for the realtime chat… to push data…
  2. 3rd party API like http://pusher.com/
  3. Long polling (ajax/jquery)

Thank you very much . Is there any other method without using node js ?

Try these options
2. 3rd party API like http://pusher.com/
3. Long polling (ajax/jquery)

As it should work realtime, you may use any library that is based on websockets like Ratchet (http://socketo.me/) for example…

1 Like

I think Ratchet is better then other.

I have created a chat with only cakephp and jquery.

Is it Real Time ? Have you used any other library that is based on web socket.

It’s real time of course.
A script (Ajax) looks for new messages every x seconds (x varies according to various situations). If there is a new message the script loads it.
If User is not connected an email is sent.
I guess it could be better with some sever side library but it works fine this way.