Node Debugging from Strollers

It is not possible to remotely debug a node server running in a Vagrant window in Chrome from my host machine. The server is configured to operate on port 8123.

Node Version: 7.10.0

In Vagrantfile:

config.vm.network :forwarded_port, host: 9229, guest: 9229 config.vm.network :forwarded_port, host: 8123, guest: 8123 

From my stray I run:

 $ node --inspect index.js Debugger listening on port 9229. Warning: This is an experimental feature and could change at any time. To start debugging, open the following URL in Chrome: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/84085f07-dc42-4e1e-bdd8-532e6dc5c4c6 --- Customer Service--- Connecting to customer repository... Connected. Starting server... Server started successfully, running on port 8123. 

When I try to access the URL in Chrome from my host machine until I get an error message, the sources tab is empty.

DevTools screenshot

+5
source share
1 answer

Based on NodeJS 11591 issue . You cannot access Vagrant materials through localhost (127.0.0.1), so you need to explicitly specify the host:

$ node --inspect=0.0.0.0:9229 index.js

Then you need to configure target detection options in Chrome. Note that 192.168.33.11 from my example is a static IP address that allows access to the Vargant host from the local host:

enter image description here

+3
source

All Articles