node.js - chromeos 上的 ssh 隧道连接被拒绝

标签 node.js google-chrome google-cloud-platform ssh-tunnel google-cloud-networking

我正在尝试设置 ssh 隧道以在本地系统上使用 chrome nodejs 调试器。

我的 Nodejs 应用托管在 Google Compute Engine 上。

这些是我在安全 shell 应用程序上给出的论点:

-L 9229:localhost:9229

SSH 连接有效,但在填写上面的隧道参数时,我不断收到以下循环错误消息:

channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused

我尝试在参数中使用 -nN,但这甚至无法完全加载我的命令行。

在 Chrome 中,网络目标似乎配置正确。

enter image description here

这些是我收到的详细错误:

channel 2: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0, nchannels 4
debug3: channel 2: status: The following connections are open:
  #1 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 102/103/104 sock -1 cc -1)
  #3 direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0 (t3 nr0 i0/0 o0/0 e[closed]/0 fd 106/106/-1 sock 106 cc -1)

debug3: receive packet: type 92
channel 3: open failed: connect failed: Connection refused
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0, nchannels 3
debug3: channel 3: status: The following connections are open:

如何解决此问题以及 channel 错误意味着什么。

如果我将端口更改为例如-L 9221:localhost:9229 并将 localhost:9221 添加到 chrome 目标发现设置中我可以在其他端口上重现该错误。

最佳答案

它已经解决了,我需要使用 --inspect-brk 添加断点,这样代码就不会完全触发。

我还需要打开 2 个 ssh session 。一份用于端口转发,一份用于编码。

关于node.js - chromeos 上的 ssh 隧道连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54159652/

相关文章:

node.js - 更新/刷新快速 session

node.js - node.js 改变它的 api 怎么样?

javascript - 使用带有多个 <Select/> 标签的 React-Select 进行 react

javascript - 从 Google Chrome Webview 获取数据到调用者/父窗口

google-cloud-platform - 执行 sql 查询 gcloud 命令行

javascript - 将表单数据发送到 firebase 函数

google-cloud-platform - Google Cloud App SDK 崩溃 → 云崩溃(LookupError): unknown encoding cp65001

node.js - TTL 过期时的事件

javascript - 如何使用 Chrome 扩展监听 url 变化

jQuery Chrome - 禁用回车键