How to make authentication SocketIO for native

in native SocketIO native cant set query or extraHeader , so how i can make authorization without query and extraHeader :frowning:

ok after read socketio.cpp , cocos ignore 2nd parameter , if its objects , so only change some codes and now i can send query with socket :smile:

Hello, May i know what code did you changed to support query?

socketio.cpp in the cocos/network lib has a handshake function, that is where you can set custom headers for authentication etc.

Similarly, it also has the handshake response there if you need to grab response headers. In my case I had to get some headers from the handshake to enable stickiness on the socket as I have multiple server nodes, and need the socket to stay on the correct node through the load balancer. This was a pain to figure out, you will need to use cocos/network’s WebSocket.cpp and the case LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: to append any headers to messages.

That i know, we already do that for Cocos2d-x c++ but for creator i am not sure how flow is working.
Did you hardcoded into handshake function or 2nd parameter from js file will be considered into socketio.cpp file? If so then how?
And thank you for your reply.