@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
63 lines (33 loc) • 1.28 kB
Markdown
---
lang: en
title: 'API docs: socketio.socketioserver.use'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/socketio
permalink: /doc/en/lb4/apidocs.socketio.socketioserver.use.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/socketio](./socketio.md) > [SocketIoServer](./socketio.socketioserver.md) > [use](./socketio.socketioserver.use.md)
## SocketIoServer.use() method
Register a sock.io middleware function
**Signature:**
```typescript
use(fn: SockIOMiddleware): Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
fn
</td><td markdown="1">
[SockIOMiddleware](./socketio.sockiomiddleware.md)
</td><td markdown="1">
</td></tr>
</tbody></table>
**Returns:**
Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>