-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Socket.IO v2.x #132
Comments
Yeah makes sense! I appreciate every contribution :) You can basically fully lean on the current implementation and try to retrofit the changes made to the protocol. A feature flag definitely makes sense, especially regarding the switch in ping and pong packets. As there are currently ongoing changes to the crate, it might make sense to sync with @nshaaban-cPacket on when and how it would make sense to implement this. When you run into questions don't hesitate to ask, I am happy to help! |
main is available to any and all contributions! No synchronization needed, happy to answer questions/point you in the right direction though. As for how to implement this, feature flag make sense (will require some changes to CI), as well as try to keep all the protocol specific logic in one (or a couple) places so we're not stepping on each other's toes and accidentally break each other's code.
No issues at all, we're all still learning! Always learning! FYI, I've setup a VSCode devcontainer for Socket.IO, if you use VSCode + Docker, it can setup all the project dependencies and CI with a couple clicks. |
I'm glad the author can help, I would like to know how to modify this existing code to support engin protocol 3? @1c3t3a |
Hey :) I really wanted support for Socket.IO v2.x (my use case is connecting to Hedgedoc from Ethersync), so I hacked it in! You can find the result in the Target versionsThe versioning scheme in the Socket.IO universe seems a bit confusing. To be clear, this implements:
You'll need this modified client to speak with a Socket.IO server with a npm package version 2.x, see this compatibility table. StatusI've only touched the async interface, and done the minimal amount of work to support my use case. Polishing this for inclusion in this crate would require at least the following things:
Doing these things will not be my current priority. I'd be really happy if someone would pick it up, though, and I'm also willing to offer support in doing so! However, even in its current state, I thought it might be useful for other folks! (Pinging @armoha @km1chno @RyanWongGithub @mortenlj) UsageTo use this fork, put the following in your rust_socketio = { git = "https://github.com/blinry/rust-socketio", branch = "socketio-v2", features = ["async"] } |
... and therefore revision 4 of Socket.IO protocol and revision 3 of Engine.IO protocol, behind feature gate I suppose.
The v3 server can communicate with v2 clients, but v3 client can't connect to a v2 server.
I'm still learning Rust and Socket.IO but I'd like to contribute if this seems good first issue,
The text was updated successfully, but these errors were encountered: