远程调试node.js应用程序,Chrome DevTools检查的设备丢失

ie3xauqp  于 2023-01-01  发布在  Node.js
关注(0)|答案(2)|浏览(138)
    • 复制步骤:**
    • 1.**我在远程服务器(Ubuntu)上运行node.js(node@12.14.0)应用程序,并使用
> node --inspect app.js
Debugger listening on ws://127.0.0.1:9229/12345678-1234-1234-1234-123456789
    • 2.**在本地(Windows 10)上配置了SSH隧道

点击"打开",我看到,在那里我输入我的密码

Using username "user".
user@site.com's password:
_
    • 3.**已配置Chrome(URI chrome://inspect/# devices)目标发现设置

    • 4.**最后,我在远程目标上看不到任何设备

但想到这种事

    • 5.**网络统计信息-a-n|服务器上的grep 9221返回

    • 我做错了什么**我怎么才能找到目标?

类似主题:1.第一个元素

mnemlml8

mnemlml81#

以下方法对我很有效

P.1以root用户身份运行node.js应用程序

> node --inspect-brk app.js

P.2对于隧道,使用Windows PowerShell和以下行

ssh -N -L 9221:localhost:9229 root@site.com
hmae6n7t

hmae6n7t2#

Discover network target中添加127.0.0.1:9229,而不是localhost:9229

相关问题