Looking into creating a web-based chat service similar to popular apps like telegram/groupme. I've already started the base design layout with html/css/javascript, but I am unsure of how the actual chatting would work. I've looked into solutions such as socket.io, but that seems more like a real time "chatroom" solution rather than direct messaging.
I've thought of my own ways of doing it like creating a new php document in a directory with a random link every time a user creates a new chat and appending the new messages to that php page. Then loading that page in whenever a user clicks on an open chat (only letting users in based off their usernames of course). However, I doubt it's that simple. Curious if you guys could enlighten me in the way of web-based direct messaging.
Thanks!
Web Sockets for client to server and backwards. Web RTC for peer to peer communication. Read about them both in MDN docs.
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
Start with the examples, they are more fun.