Sending to individual socketid in Socket.IO

// sending to individual socketid (private message)`${socketId}`).emit('hey', 'I just met you');

// WARNING: `` will NOT work, as it will send to everyone in the room
// named `` but the sender. Please use the classic `socket.emit()` instead.


One Comment on “Sending to individual socketid in Socket.IO”

  1. Hello! I used exactly the same code. But io didn’t emit the socket that i send.
    I used that way:`${socketId}`).emit(“output road”, { engineData: userdata })

    socketId is coming from the session and ‘output data’ is expecting front-end.

Comments are closed.