Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a real-time chat with php and javascript

My goal is to create a real-time chat similar to the Facebook chat, from scratch. I want to store all the messages on a database table (MySQL) and every time a new message is sent by a user, if the receiver is connected then a request will be sent to the receiver's browser and the message will appear on the chat window.

I don't want to have the client to check if a new message for the user was sent, but I want the server to send the request to the client's browser.

I know that this can be achieved using the Comet technique (I saw this stackoverflow question) but I am not able to find a good guide on how to implement this for this certain problem.

I want to use php and javascript and as less extra software or frameworks as possible.

I use WAMPServer and I have Windows.

If you know a good guide or tutorial or can provide any guidelines on how I could achieve what I want, it would be very helpful.

like image 785
Thanasis1101 Avatar asked Jun 14 '17 17:06

Thanasis1101


People also ask

What allows online conversations in real-time?

Apple's Messages. Google Talk. AOL Instant Messenger (AIM) Internet Relay Chat (IRC)


1 Answers

Try use for this CppComet open source comet server. There have api for php and other languages. And viwe this chat example or this

like image 60
Trapenok Victor Avatar answered Sep 18 '22 18:09

Trapenok Victor