Sockets can't communicate JavaScript objects or anything that can't be stringified simply. If who
is an object as in {x: "monkey"}
, you probably want to use who.x
instead, which is a string:
socket.nick = who.x;
You could also stringify the object to JSON and then parse it on the client:
socket.nickJson = JSON.stringify(who);