chromeos上的ssh隧道连接被拒绝

时间:2019-01-12 12:37:04

标签: 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:

该如何解决?通道错误是什么意思。

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

1 个答案:

答案 0 :(得分:2)

解决了,我需要使用--inspect-brk添加一个断点,以便代码不会完全触发。

我还需要打开2个ssh会话。一种用于端口转发,另一种用于编码。