Skip to content

node --inspect devtoolsFrontendUrl using docker container IP #13294

@glumn

Description

@glumn

Version: v7.10.0
Platform: Linux fad72c3b2219 4.9.27-moby #1 SMP Thu May 11 04:01:18 UTC 2017 x86_64 GNU/Linux

Hi,

Running node 7.10.0 on a Docker Container, version: 17.03.1-ce-mac12 (17661), channel: stable.

For development purposes, I'm running node with --inspect with the following command:
./node_modules/.bin/nodemon --inspect=0.0.0.0:9229 index.js

Console output following this is:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=0.0.0.0:9229/79ee5f22-17fa-4878-baf5-1aed2b8ca12b
This works fine and lets me inspect and drop breakpoints inside my code.

However, I'm trying to use NIM to automatically pickup and open the new devtools url when my code changes.
NIM takes the devtoolsFrontendUrl from http://localhost:9229/json, which in this current case is:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=172.18.0.2:9229/79ee5f22-17fa-4878-baf5-1aed2b8ca12b
This does not work: I can't inspect my code through this url.

Essentially, devToolsFrontendUrl spits out my container's IP whereas the console log correctly uses the 0.0.0.0 IP that I provided to --inspect
I'm forced to change the ip to 0.0.0.0 to make it work.

Any idea why it behaves that way, and what I can do to automatically pickup the correct address ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions