-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
namespace(nsp) format is wrong #41
Comments
Don't add the first slash to the option |
It should never get to the engine prepended with a slash. Unless you do something stupid like https://github.com/socketio/socket.io-client-swift/blob/master/SwiftIO/SocketIOClient.swift#L107 |
we should use Client.prototype.ondecoded = function(packet) {
if (parser.CONNECT == packet.type) {
this.connect(packet.nsp);
} else {
var socket = this.nsps[packet.nsp];
if (socket) {
socket.onpacket(packet);
} else {
debug('no socket for namespace %s', packet.nsp);
}
}
}; ps: I have updated the latest repo code. |
Now I know why. self.socket.emit("authentication", "{\"token\":\"\(token)\"}") in server // socket.io-parser
// index.js
function decodeString(str) {
...
// look up json data
if (str.charAt(++i)) {
try {
var a = str.substr(i)
p.data = json.parse(a);
} catch(e){
return error();
}
}
...
} |
Thank you all guys contributed this awesome project. but there is some thing seems not right.
we should send namespace like this:
0/chat
but in joinNamespace()
self.engine?.send("0/\(self.nsp!)")
and it will be
0//chat
, the server will complain it.The text was updated successfully, but these errors were encountered: