docs: document opening the inspector at runtime with node:inspector#3375
Merged
Conversation
Add a section to the debugging page covering inspector.open() / url() / close() / waitForDebugger() from node:inspector, with a server example and the --allow-net requirement. node:inspector is functional, not a stub, so this also clears up the confusion in the feedback issues. Closes #3371. Closes #3372.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The debugging guide only covered the
--inspectflag family, so therewas no mention of opening the inspector from inside a running program.
Two feedback issues asked for exactly this, and one was additionally
confused by the
node:inspectorAPI reference describing the module asmostly non-functional stubs.
Adds an "Activating the inspector at runtime" section to the debugging
page documenting
node:inspector:inspector.open([port][, host][, wait])to start the inspector server on demand (default127.0.0.1:9229,needs
--allow-net), plusinspector.url(),inspector.close(),inspector.waitForDebugger(), and a note aboutSessionfor issuingChrome DevTools Protocol commands directly. Includes a server example
that opens the inspector when a
/debugrequest comes in, and a securitycaution about binding to a public IP.
node:inspectoris in fact functional in Deno (open,close,url,waitForDebugger,Session,Network,console), so spelling this outon the debugging page also addresses the "does inspector.open function?"
confusion. I verified the behavior, defaults, and the net-permission
check against the implementation in
ext/node/ops/inspector.rsandext/node/polyfills/inspector.js.Closes #3371.
Closes #3372.