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

preview_player
Показать описание
Source Code:

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.
Рекомендации по теме
Комментарии
Автор

Aoa, brother i was working with sockets other than for a chat application. I encountered a problem that i want to emit event from one file and listen to it into another file but its not working. It works only when the event recieiving file emits the emit. How to solve it brother??

hammadraza
Автор

can you do this on python though, I have a project and I'm stuck

amineaouissaoui
Автор

PHP wasn't expected. I hoped plain node js server is used here, from the name of video

olegnikitindev
Автор

Very helpful & perfect video. Can you please say that how to connect a android app same like the JS functionalitis used in your PHP code?

MusabbirMamun