Skip to content

feat(inspector): accept bare host and bare port for --inspect flag#31881

Merged
bartlomieju merged 5 commits intodenoland:mainfrom
bartlomieju:parse_inspector_address
Jan 20, 2026
Merged

feat(inspector): accept bare host and bare port for --inspect flag#31881
bartlomieju merged 5 commits intodenoland:mainfrom
bartlomieju:parse_inspector_address

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

This commit changes arg parsing for --inspect, --inspect-brk and --inspect-wait flag
to allow passing values as follows:

  • 127.0.0.1 -> 127.0.0.1:9229
  • 192.168.0.1 -> 192.168.0.1:9229
  • :10000 -> 127.0.0.1:10000
  • 10000 -> 127.0.0.1:10000
  • :0 -> 127.0.0.1:<OS assigned port>
  • 0 -> 127.0.0.1:<OS assigned port>
    This matches what Node.js is doing and will help to solve test compatiblity discovered in fix(ext/node): set process.features.inspector #31863.

@bartlomieju bartlomieju marked this pull request as ready for review January 18, 2026 22:41
let tcp_listener = std::net::TcpListener::bind(host)
.map_err(|source| InspectorServerError::Connect { host, source })?;
tcp_listener.set_nonblocking(true)?;
// TODO(bartlomieju): update process wide inspector server host
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a TODO for a future PR - I'll address once working on #31863

@bartlomieju bartlomieju requested a review from dsherret January 18, 2026 22:42
@bartlomieju bartlomieju changed the title fix(inspector): accept bare host and bare port for --inspect flag feat(inspector): accept bare host and bare port for --inspect flag Jan 18, 2026
Copy link
Copy Markdown
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bartlomieju bartlomieju merged commit 757db1e into denoland:main Jan 20, 2026
20 of 25 checks passed
@bartlomieju bartlomieju deleted the parse_inspector_address branch January 20, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants