Module layer

Source
Expand description

§A tower Layer for socket.io so it can be used as a middleware with frameworks supporting layers.

§Example with axum :
// Create a socket.io layer
let (layer, io) = SocketIo::new_layer();

// Add io namespaces and events...

let app = axum::Router::<()>::new()
    .route("/", get(|| async { "Hello, World!" }))
    .layer(layer);

// Spawn axum server

Structs§

SocketIoLayer
A Layer for SocketIoService, acting as a middleware.