socket.Io issue in newer version

时间:2016-04-07 10:48:45

标签: node.js sockets socket.io

I'm following this old guide and try to convert it to newer version of socket.io

My issue is that this code var myNamespace = self.namespace.connected[socket.id]; dosen't work in newer versions.

I believe that it is the [socket.id] that has been changed in newer versions.

I saw this post and the last comment has the same problem as I but no solutions. https://github.com/socketio/socket.io/issues/1618

1 个答案:

答案 0 :(得分:0)

我找到了解决方案

var myNamespace = self.namespace.connected['/name_space#' +socket.client.id];