From ccc51ca7149e5933d4fe92e6b1d15303d7e23230 Mon Sep 17 00:00:00 2001 From: Aleksei Koziatinskii Date: Thu, 16 May 2019 15:33:09 -0700 Subject: [PATCH] inspector: added --inspect-publish-uid This flag specifies how inspector websocket url should be reported. Tthre options are supported: - stderr - reports websocket as a message to stderr, - http - exposes /json/list endpoint that contains inspector websocket url, - binding - require('inspector').url(). Related discussion: https://github.com/nodejs/diagnostics/issues/303 --- doc/api/cli.md | 8 +++ src/inspector_agent.cc | 5 +- src/inspector_io.cc | 15 ++++-- src/inspector_io.h | 7 ++- src/inspector_socket_server.cc | 55 +++++++++++++++------ src/inspector_socket_server.h | 2 + src/node_options.cc | 21 ++++++++ src/node_options.h | 9 ++++ test/cctest/test_inspector_socket_server.cc | 6 ++- test/parallel/test-inspect-publish-uid.js | 42 ++++++++++++++++ 10 files changed, 148 insertions(+), 22 deletions(-) create mode 100644 test/parallel/test-inspect-publish-uid.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 40163d84b21ec9..d755081b4db39c 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -389,6 +389,13 @@ default) is not firewall-protected.** See the [debugging security implications][] section for more information. +### `--inspect-publish-uid=stderr,http` + +Specify ways of the inspector web socket url exposure. + +By default inspector websocket url is available in stderr and under `/json/list` +endpoint on `http://host:port/json/list`. + ### `--loader=file`