leonceaklin
expose HTTP + Websockets for (rather monolithic) Node.js-Application
Hey there,
You are absolutely right of course. I just needed to configure my nest.js application differently, mainly by NOT specifying the port in the @WebsocketGateway() explicitly in nest.js. Otherwise you get an EADDRINUSE error, which made me think that ws and http is not possible on the same port.
I also needed to specify a path for WebsocketGateway to have a specific endpoint:
The connection is now possible through this exact path. Thank you for pointing out that running http and ws on different endpoints is indeed possible.
7 replies