Jump to content

Need help on programming a real-time chat application using PHP WebSocket


Recommended Posts

Posted (edited)

Hi, I'm creating a social media with a real-time chat application using PHP WebSocket, the basic functionalities are working properly but I need to implement some other features as well. So I need help with the following related to the chat application:

  1. Login to the WebSocket using the credentials users use to log into the social media.
  2. Allow users to chat with their friends only.
  3. Identify users from the database using their ID and fetch data from the database.
  4. Show online/offline status based on the WebSocket.
  5. Show if a message is pending/sent/delivered/seen status.
  6. Show typing notification to the other user.

I'm attaching a screenshot of the chat screen:

image.thumb.png.5201a746609b23040bf424b4983150d5.png

Edited by sagnik
Added another reason
Link to comment
Share on other sites

  • 2 weeks later...

Logins via social media are usually done using OAuth and OpenID Connect, which can be non-trivial to implement. For development purposes, as long as you're just testing on your own computer, I'd recommend building a mock login flow that just takes a username. It would be far too insecure to expose to the public Internet, but it would give you an opportunity to work out your database layer, which will be required for OAuth anyway.

Link to comment
Share on other sites

Thanks for the advice, but the service has its login service, which uses SSO but the problem is handling the sessions within the WebSocket server for multiple clients.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...