Socket io handshake response code 400

server node.js v0.10.33
socket io v 1.2.1
socket io adapter 0.3.1

client cocos2d-x v3.2

console error
SIOClientImpl::handshakeResponse() called
handshake completed
response code: 400
SIOClientImpl::handshake() failed
error buffer:
cfailed

google search
Socketio.cpp

// pre << “http://” << _uri << “/socket.io/1”;
pre << “http://” << _uri << “/socket.io/?transport=polling&b64=0”;

change response code : 200
Immediately after the break connections
Not being able to make any changes
Please tell us the solution

Hi kbizzang,

A google search brought me to your post, sorry I didn’t see it before. The native code to connect to socket.io works with socket.io server v0.9.17 (I just tested it on my machine, versions previous and after this version have different handshake methods), you can set the socket.io version to “0.9” in your server’s package.json and it will download the appropriate version.

I will try to take a look at the handshake for v1.0 and see if I can update the method, but we might need some help from Automattic on that one.

FYI, for anybody interested, Automattic made significant changes to the socket.io handshake process in versions 1.0 and above, they still have yet to document and publish how this works. This means that just about everybody writing a custom client for socket.io is confused, see the following for more info:

https://github.com/Automattic/socket.io/issues/1577
https://github.com/Automattic/socket.io-protocol/issues/10