Is it possible to run one NestJS WebSocketGateway several times with different parameters? Maybe possible to use microservices for this?
1 Answer
Yes, it is possible to create as much WebSocketGateway
as you want. All you need is to register your gateways in providers
property of your @Module
. Gateways with same port will use only 1 socket.io
server instance. When you create gateway with another port, NestJS will create one more server instance and so on.