google 云控制台设置防火墙上的节点检查
node inspect on google cloud console setup firewall
我正在尝试设置防火墙以使用本地 chrome 浏览器访问节点检查。
有人有好的简短指南吗?我需要启用哪个 tcp 协议。
我有一个防火墙规则处于活动状态,其中计算实例启用 tcp:80。它在 http 服务器的过去工作。我如何知道节点检查使用哪个端口以及如何启用它。
如果我自己找到的话。我必须使用 ssh 隧道。 https://nodejs.org/en/docs/guides/debugging-getting-started/#enabling-remote-debugging-scenarios
Enabling remote debugging scenarios
We recommend that you never have the debugger listen on a public IP address. If you need to allow remote debugging connections we
recommend the use of ssh tunnels instead. We provide the following
example for illustrative purposes only. Please understand the security
risk of allowing remote access to a privileged service before
proceeding.
Let's say you are running Node on remote machine, remote.example.com, that you want to be able to debug. On that
machine, you should start the node process with the inspector
listening only to localhost (the default).
$ node --inspect server.js
Now, on your local machine from where you want to initiate a debug client connection, you can setup an ssh tunnel:
$ ssh -L 9221:localhost:9229 user@remote.example.com
This starts a ssh tunnel session where a connection to port 9221 on your local machine will be forwarded to port 9229 on
remote.example.com. You can now attach a debugger such as Chrome
DevTools or Visual Studio Code to localhost:9221, which should be able
to debug as if the Node.js application was running locally.
我正在尝试设置防火墙以使用本地 chrome 浏览器访问节点检查。
有人有好的简短指南吗?我需要启用哪个 tcp 协议。
我有一个防火墙规则处于活动状态,其中计算实例启用 tcp:80。它在 http 服务器的过去工作。我如何知道节点检查使用哪个端口以及如何启用它。
如果我自己找到的话。我必须使用 ssh 隧道。 https://nodejs.org/en/docs/guides/debugging-getting-started/#enabling-remote-debugging-scenarios
Enabling remote debugging scenarios We recommend that you never have the debugger listen on a public IP address. If you need to allow remote debugging connections we recommend the use of ssh tunnels instead. We provide the following example for illustrative purposes only. Please understand the security risk of allowing remote access to a privileged service before proceeding.
Let's say you are running Node on remote machine, remote.example.com, that you want to be able to debug. On that machine, you should start the node process with the inspector listening only to localhost (the default).
$ node --inspect server.js
Now, on your local machine from where you want to initiate a debug client connection, you can setup an ssh tunnel:
$ ssh -L 9221:localhost:9229 user@remote.example.com
This starts a ssh tunnel session where a connection to port 9221 on your local machine will be forwarded to port 9229 on remote.example.com. You can now attach a debugger such as Chrome DevTools or Visual Studio Code to localhost:9221, which should be able to debug as if the Node.js application was running locally.