rust-socketio icon indicating copy to clipboard operation
rust-socketio copied to clipboard

Add a server implementation

Open 1c3t3a opened this issue 4 years ago • 4 comments

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.

1c3t3a avatar Mar 24 '21 17:03 1c3t3a

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

Requirements:

  • HTTP polling server
  • Websocket server
  • Basic async (one thread per client) Goals:
  • Room support
  • Secure websocket server
  • HTTPS polling server Stretch Goal:
  • Full async support? Change your mind on https://github.com/1c3t3a/rust-socketio/pull/17 ?
  • Full socket.io/engine.io server support

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

ctrlaltf24 avatar Jul 16 '21 00:07 ctrlaltf24

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!

1c3t3a avatar Jul 16 '21 09:07 1c3t3a

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.

ctrlaltf24 avatar Jul 17 '21 01:07 ctrlaltf24

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.

tausifcreates avatar Oct 08 '23 16:10 tausifcreates