【问题标题】:Node.js remote debug on AzureAzure 上的 Node.js 远程调试
【发布时间】:2016-05-23 16:19:19
【问题描述】:
我关注了这篇帖子Debugging Node.js Azure Web Apps 并相应地设置了我的环境。
似乎“mysite.azurewebsites.net/server.js/debug”连接到服务器并加载脚本,但 Websocket 连接返回。
Overrides.js:17 WebSocket connection to 'ws://mysite/server.js/debug/ws'
failed: Error during WebSocket handshake: Unexpected response code: 500
2016-02-12 15:14:20.147 Overrides.js:27 EventonWebSocketError @ Overrides.js:27
【问题讨论】:
标签:
node.js
azure
azure-web-app-service
remote-debugging
【解决方案1】:
目前您可以使用 iisnode-inspector.dll 的旧方法。在iisnode.yml 中设置debuggerExtensionDll: iisnode-inspector.dll 以通过iisnode 调试node.js 脚本,如issue#388 所示的解决方法。
此外,您还可以利用 Azure Web Apps 上的 VSO 扩展,它提供了在线编辑器和 cmdlet 工具。可以参考this thread on MSDN
【解决方案2】:
您是否从 Azure 门户启用了 WebSockets? WebSockets 默认禁用,必须手动启用。
【解决方案3】:
似乎 Azure 上最新的 Node Inspector 可能有问题。请尝试以下操作以返回到早期版本。在你的 web.config 中,设置这个:
<iisnode debuggerExtensionDll="iisnode-inspector.dll" />
此外,您可以关闭旧版本的 WebSockets,因为它不需要它。