1

Is it possible to run one NestJS WebSocketGateway several times with different parameters? Maybe possible to use microservices for this?

1 Answer 1

6

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.

1
  • What about setting another parameters to the gateway?
    – Morbo
    Dec 6, 2018 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.