1c3t3a / rust-socketio

An implementation of a socket.io client written in the Rust programming language.
MIT License
412 stars 76 forks source link

Store cookies for sticky session #474

Open DanielChabrowski opened 1 week ago

DanielChabrowski commented 1 week ago

Hi, I've noticed that the recommended way of using multiple socket.io server nodes that do http long-polling and therefore maintaining a sticky session is to be done via cookies - according to https://socket.io/docs/v4/using-multiple-nodes/.

However, this crate does not seem to support that as reqwest's cookie store needs to be enabled as a feature and through a client builder.

Would you consider adding that functionality? I'll happily prepare a PR.

DanielChabrowski commented 1 week ago

This might not be that easy as I initially thought due to the fact that there are two transports created - one for handshake and one afterwards with the SID which wouldn't share cookies.