I am working on a project where i am trying to build an interface like If user is logged in and in between that if sever has any message for that user then the user will get notify immediately (Like facebook ) so for i am going through websockets but confused from where should i start ? please suggest me some basic ideas ?
I am using PHP as a language for implementation
I'm looking for advice at the moment on achieving real-time notifications using a mix of PHP, NodeJS and socket.io. At the moment I have done next to nothing with Node and socket.io so I'm at a loss with the best way to achieve this. I've done some basically listening and what not but nothing extreme.
For now my questions are:
- How will socket.io know of new notifications, should PHP be responsible for sending the data (say a post was created) to socket.io and from there broadcasting to connected clients?
- How does socket.io know which clients want the notifications?
I'm really not sure what else. This is all a bit much for me at the moment. I just can't get my head around how the notifications will be distributed.
Any advice would be greatly appreciated. I don't expect a detailed walk through, just a push in the right direction or some knowledge on how it all meshes.