socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

Trouble with Authentication

Open braaandon opened this issue 3 years ago • 1 comments

Struggling to understand why the querystring works but the auth parameter does not (it is not sent at all).

Querystring Code

    client.connect(uri, {{"token", token}});

Auth Code:

     sio::message::ptr auth = sio::object_message::create();
     auth->get_map()["token"] = sio::string_message::create(token);
     
     client.connect(uri, auth);

braaandon avatar Jan 23 '22 17:01 braaandon

According to #335, you should use socket.handshake.auth to get the auth object. More information of your server codes are needed to debug.

zeze-zeze avatar Jul 06 '22 11:07 zeze-zeze