You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/websockets/adapter.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,25 +30,32 @@ The WebSockets module is platform-agnostic, hence, you can bring your own librar
30
30
The [socket.io](https://github.com/socketio/socket.io) package is wrapped in an `IoAdapter` class. What if you would like to enhance the basic functionality of the adapter? For instance, your technical requirements require a capability to broadcast events across multiple load-balanced instances of your web service. For this, you can extend `IoAdapter` and override a single method which responsibility is to instantiate new socket.io servers. But first of all, let's install the required package.
31
31
32
32
```bash
33
-
$ npm i --save socket.io-redis
33
+
$ npm i --save redis socket.io @socket.io/redis-adapter
34
34
```
35
35
36
36
Once the package is installed, we can create a `RedisIoAdapter` class.
0 commit comments