I use NodeJs v0.10.28, and every time I try to enter the chat, I get an error
TypeError: Object #<Socket> has no method 'set' at Socket.<anonymous>
And if I delete the lines, this works, but does not work correctly.
What's wrong with this code
// get the name of the sender socket.get('nickname', function (err, name) { console.log('Chat message by ', name); console.log('error ', err); sender = name; });
and
socket.set('nickname', name, function () { // this kind of emit will send to all! :D io.sockets.emit('chat', { msg : "Welcome, " + name + '!', msgr : "Nickname" }); });
FULL CODE
http://pastebin.com/vJx7MYfE
source share