Real Time Chat Module


#1

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


#2

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)

#3

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


#4

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


#5

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


#6

I think Ratchet is better then other.


#7

I have created a chat with only cakephp and jquery.


#8

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


#9

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.