Node.js remote debugging from local Chrome


This is a question about using Chrome on my local machine to debug Node.js that is running in GitPod. I don’t have a problem running the in-built debugger, but I’m keen to run the debugger in Chrome Dev Tools in order to benefit from the live code edit support (which as far as I can tell in the VS Code debugger requires the process to be reloaded).

My understanding of what should be necessary to make this happen is the following:

  1. In GitPod, run node --inspect= test.js (the is apparently necessary to allow the debugger to be connected to from any remote client -
  2. Click to allow the 9229 port to be public in Gitpod, then open up the exposed port in Chrome
  3. Assuming the host is, go to to get the URL in the devtoolsFrontendUrl property of the returned JSON - this is like devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=localhost:9229/<some-uuid>
  4. Paste that URL into Chrome, replacing localhost:9229 with (port 443 for HTTPS)
  5. Then you should connect successfully

There are two odd things:

  • The dev tools’ websocket connection fails, as can be seen in the network tab (HTTP status code 400)
  • In step 1, if you do provide, then the /json/list path in step 2 is not available

One path may be to set up a local SSH tunnel to the debugger. There is a thread about setting up a SSH tunnel to a Gitpod workspace here -; and the information about connecting to a remote node.js process over SSH is here - see the Node.js docs linked to above. But before I go down that road, I wanted to surface what I’m doing already in case there’s a gotcha I’m just missing.

Hi @jayfresh,

I couldn’t tell you the reason but the following works for me:

  1. Run node --inspect test.js (without
  2. Make 9229 public.
  3. Change not just localhost in the devtools:... URL but also change ws to wss (since it’s a secured connection). My URL looks like this:

Let me know if it works for you as well.

1 Like

Yes, amazing, it was the change from ws to wss that did it, thank you!

1 Like