Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/socket_io/mod.ts>Server#use

Socket.IO server for Deno
Latest
method Server.prototype.use
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) => { // ... });

Parameters

fn: (socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>) => Promise<void>
  • the middleware function