Is it possible to run one NestJS WebSocketGateway several times with different parameters? Maybe possible to use microservices for this?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With