hola que tal eh estado intentando y buscando mucho por google y otras web pero no encuentro informacion sobre como lograr esto:
Código Javascript
:
Ver originalvar io = require('socket.io').listen(8080);
io.sockets.on('connection', function(socket) {
var client = socket.id;
socket.join(socket.id);
io.sockets.in(socket.id).emit('on', client);
socket.on('newMensaje', function(data) {
var end = [socket.id, data]
io.sockets.in(socket.id).emit('resMsj', end);
});
socket.on('logUser', function() {
io.sockets.emit('useJoin', client);
});
socket.on('privChat', function(data){
socket.leave(data.id);
});
});
solo logre que emitiria entre si mismo pero cuando hago el privChat con la data del usuario selecionado el leave no hace nada que puede que este mal.?