1c3t3a / rust-socketio

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

Add a server implementation #32

Open 1c3t3a opened 3 years ago

1c3t3a commented 3 years ago

Until now this crate only provides a socketio client. A possible server implementation could use the same packet parser and maybe parts of the engine.io socket.

ctrlaltf24 commented 3 years ago

I'm planning on implementing this. Here are some thoughts on requirements:

Requirements:

@1c3t3a Thoughts? Have anything to add or preferences on how/frameworks they are implemented in?

1c3t3a commented 3 years ago

Hei @nshaaban-cPacket this sounds great! I think a server implementation is definitely the most needed feature for this crate. I think the basic requirements are a full match of what I would expect, especially websocket support is important as long-polling is nearly never used anymore, but still needs support as the backup transport layer. Looking at the dependencies I would think it might be a good idea to reuse all transport related crates and not add too many new ones as this would probably bloat our build a lot. Looking at the http server, I would suggest to use rouille. I used it once and it's a pretty lightweight implementation, but feel free to use another one. I would also like to have the stretch goal of a full async support for the client and server, but I think that adding a stable version of the server with all features is enough work to keep us busy for a while. To be honest I am super happy to have a contributor helping to implement such a big feature, thanks a lot!

ctrlaltf24 commented 3 years ago

Sounds good. Thank you for having a good base to start with! And with such good documentation! Did you want to continue to support sync and full async? If so there may need to be some internal organization which makes as much code as reasonably beneficial async, while still keeping sync endpoints functional without duplicating code.

tausifcreates commented 11 months ago

There is a rust server implementation already in development here: https://github.com/totodore/socketioxide Please contribute with code or sponsor the guy to further accelerate the development.