How do i send a message to a specific client, more specifically, the client that has just connected to the app without broadcasting to the rest of the visitors that are already on the site?
io.sockets.on('connection', function(client) {
});
Seems to broadcast to everyone every time a new visitors connects.
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
socket.emit('greetings', { greeting:'hello, new visitor' });
socket.on('greetingFromVisitor', function (data) {
console.log(data);
});
});