Port Already in use error for LB4 app using socket #7665
Unanswered
siddharthmutkekar
asked this question in
Q&A
Replies: 1 comment
-
I added my solution to this discussion. #7175 My solution You can also try to use microservices (but I didn't test it). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I am working on LB4 application which exposes REST API's on port 3000 and also has lifecycle obervers to connect to Rabbit mq during application startup. Another requirement is to add websocket server for this LB4 application. I followed the example - https://github.com/alexkander/loopback4-example-websocket-app to add socket code in my LB4 app. But when I try starting the application, it gives me error "port already in use". So I changed the websocket port (in index.ts) to 5000 and also commented out line await super.start() in webserver.application.ts and then the application starts. But the lifecycle obersers do not get executed on application startup. But the REST API's start on port 3000 and socket server starts on port 5000. So my question is how to start websocket server and REST API's on same port 3000 along with lifecycle obversers getting executed at the application startup ?
Thanks,
Siddharth
Beta Was this translation helpful? Give feedback.
All reactions