leonceaklin
leonceaklin
RRailway
Created by leonceaklin on 8/7/2023 in #✋|help
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:
@WebsocketGateway({
path: '/realtime'
})
@WebsocketGateway({
path: '/realtime'
})
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
RRailway
Created by leonceaklin on 8/7/2023 in #✋|help
expose HTTP + Websockets for (rather monolithic) Node.js-Application
7e07ecbc-0807-492d-b96b-270cfda10eeb
7 replies