Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Support dynamic port assignment via --inspect-port=0 #153

Closed
@auchenberg

Description

@auchenberg

It's possible to start Node with node --inspect-port=0 that assignes a dynamic port to the inspector server.

When using it together with a dynamic attach config like:

        {
            "type": "node",
            "request": "attach",
            "name": "Node",
            "processId": "${command:PickProcess}",
            "protocol": "inspector",
            "trace": "verbose"
        }

We end up failing to attach, as we try on the default port

Discovering targets via http://127.0.0.1:9229/json
HTTP GET failed: Error: connect ECONNREFUSED 127.0.0.1:9229

but the Inspector server is running the dynamically assigned port

Find the server at: http://localhost:3001/
Debugger listening on ws://127.0.0.1:51514/64e041f8-0433-4d33-9d11-408359869e84
For help see https://nodejs.org/en/docs/inspector

Idea: When the given process has been selected, attach to the strout, parse the output to find the used port. use that for attach

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions