feat: add authentication token support
I've added the possibility of using an authentication token when opening a connection. Here's how to use this feature:
client = SocketIOClient.new(backendURL, { "token": "YOUR_TOKEN_HERE" })
Hey thanks for the PR. I took a look at this discussion here https://github.com/socketio/socket.io/discussions/4072 for the implementation of auth token. So it looks like you only send it with CONNECT packet. I think there's a better way to implement this. I'll create another branch and let you try it.
See if this feat-auth works
Thank you for your reply, I've just tried your version on my project, it works pretty well, in fact I think it's a better integration, I haven't done any more in-depth testing so I can't assure you of 100% stability.
Suggestion : wouldn't passing the namespace as the second argument to the socketio_connect function be better for code readability, so that you don't have to write "/" every time you want to use the function with a default namespace ? Having said that, the socketio_connect function is not used very often, so this enhancement may not be necessary. I'll let you decide.
Thanks for the update! Yes I agree with you. I've changed it to the init function like how you did in the pr. Will merge to main branch.