远程调试在AWS上托管的节点应用程序 [英] Remotely debugging my node app that is hosted on AWS
本文介绍了远程调试在AWS上托管的节点应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从我的开发机器连接到在AWS(node -debug app.js)上以调试模式运行的节点服务器,并且可以远程调试我的应用程序。
I would like to connect to my node server running in debug mode on AWS (node --debug app.js) from my development machine, and be able to debug my app remotely.
两个问题:
-
我可以用node-inspector这样做吗?我希望可以,但是节点检查器无法安装在我的AWS实例上。
Can I do this with node-inspector? I wish I could, but node-inspector fails to install on my AWS instance.
任何可以让我这样做的选择?
Any alternatives that will allow me to do this?
推荐答案
在 tepez的答案,以下为我工作(Node Inspector v0.12.2):
And with the help of tepez's answer, the following worked for me (Node Inspector v0.12.2):
在我的机器上:
ssh -L 8080:127.0.0.1:8080 <username>@<host> -N
在远程服务器上:
node-debug --cli <appname>
然后在浏览器中输入以下地址:
And enter the following address in the browser:
127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858
这篇关于远程调试在AWS上托管的节点应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文