Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set nodejs debug mode don't listen 127.0.0.1

I want to remote debug the nodejs program in Eclipse. I start the node script with the debug option.

$node debug script.js

But I can't connect to the node in Eclispe. When I netstat the node's TCP port. I found that node only listen 127.0.0.1 in debug mode. So I can't connect it from different computer.

But I can't find any startup options that can change to listen to any address.

Anyone know to make it listen to any address to remote debug in other computer?

like image 843
Magic Avatar asked Dec 01 '22 23:12

Magic


1 Answers

if anyone else stumble upon this: you can set the node debug to any address as you set the port

node --debug=169.168.1.2:5858 app.js

if that would be the ip of your remote machine or even better to every machine

node --debug=0.0.0.0:5858 app.js

but please be aware that the 2nd option should only be used if you are debugging in your own private network as you open it up for everyone

like image 64
Finn Avatar answered Dec 23 '22 05:12

Finn