How to Send Socket Events to Specific User - Node JS, Socket IO

Опубликовано: 12 Октябрь 2024
на канале: Adnan Afzal
25,160
283

Source Code:
https://adnan-tech.com/send-socket-ev...

Suppose you have a chat app where you want 2 people to have a private chat. Now you want to have a real-time effect i.e. to show the new messages without having to refresh the page. This requires sockets that send the data in real-time. And we can show the data on the client-side in real-time too. Now when a sender sends a message to a specific user, we need to send the socket event to that specific user only.