Monday, March 6, 2017

Real time Chat application with PHP & Websockets

I want to create chat application in a webapp where user can chat with different site users. This will be available on web and also on iOS.

Instead of using traditional polling technique (send ajax hit to server in 1 sec interval), i want to use websockets.

Gone through couple of tutorials, but in all of them they have made PUBLIC GROUP chat. (Sample URL : https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket)

Can anyone have idea to how to develop private chat using PHP & Websockets.

I have basic idea of websockets but how to use them to publish data on specific channel? And if we have 40 users so do we need to create 40 different channels?

Thanks in advance.



via Gaurav Bakshi

Advertisement