Totodore / socketioxide

A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.

Home Page:https://docs.rs/socketioxide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add middlewares services to namespaces

Totodore opened this issue · comments

Is your feature request related to a problem? Please describe.
Currently there is no way to add middlewares to namespaces in the same way than with the official implementation:
https://socket.io/docs/v4/middlewares/#handling-middleware-error

Describe the solution you'd like
A namespace could hold a Vec of dynamic tower::Service or tower::Layers and they would be used to validate or not the request.
This solution would allow the use of tower_http services and any other service lib as middlewares.

Before starting any implementation, we need more specifications and tests to check that tower services are a good fit for this functionality.