import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.ts";
Registers a middleware, which is a function that gets executed for every incoming Socket.
Examples
io.use(async (socket) => {
// ...
});
io.use(async (socket) => { // ... });
Parameters
fn: (socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>) => Promise<void>
- the middleware function