import { IoAdapter } from '@nestjs/platform-socket.io' ; import * as redisIoAdapter from 'socket.io-redis' ; import { INestApplicationContext } from '@nestjs/common' ; export class RedisIoAdapter extends IoAdapter { constructor ( private readonly redisConfig , appOrHttpServer ? ) { super ( appOrHttpServer ) ; } createIOServer ( port , options ? ) { const redisAdapter = redisIoAdapter ( this . redisConfig ) ; const server = super . createIOServer ( port , options ) ; server . adapter ( redisAdapter ) ; return server ; } }