Page Contents

Home > @loopback/socketio > SocketIoServer > use

SocketIoServer.use() method

Register a sock.io middleware function

Signature:

use(fn: SockIOMiddleware): Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>;

Parameters

Parameter Type Description
fn [SockIOMiddleware](/doc/en/lb4/apidocs.socketio.sockiomiddleware.html)

Returns:

Server<import(“socket.io”).DefaultEventsMap, import(“socket.io”).DefaultEventsMap, import(“socket.io”).DefaultEventsMap, any>