3

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

1 Answer 1

9

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.

Sign up to request clarification or add additional context in comments.

2 Comments

What about setting another parameters to the gateway?
@Morbo I have same question

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.