I'm trying to remote debug nodejs 9 inside docker.
> testnodedockerproj@0.0.0 debug /home/deb
> node --inspect=9229 ./bin/www
Debugger listening on ws://127.0.0.1:9229/75db828f-4b4b-491c-99d1-0eb60a82e45c
For help see https://nodejs.org/en/docs/inspector
http://localhost:3100/ responds
GET /robots.txt 404 1752.471 ms - 905
GET / 304 1838.729 ms - -
GET /stylesheets/style.css 304 114.501 ms - -
But I can't connect to ws://127.0.0.1:9229/75db828f-4b4b-491c-99d1-0eb60a82e45c.
The docker compose file has this port config:
ports:
- "3100:3000"
- "9339:9229"
I can connect to the node debug url from inside the docker container. But I can't reach it from my host system. The expected endpoint should be ws://127.0.0.1:9339/75db828f-4b4b-491c-99d1-0eb60a82e45c and it is unaccessible.
Is there any specific docker config which enables the connection to the web socket?
How do I reach this node debug endpoint?
@Update
I've managed to connect to the debug endpoint.
The node debug command should be:
node --inspect=[::]:9229 ./bin/www
In this way I can connect to the port 9339 and attach a debugger.