【发布时间】:2012-12-17 18:18:57
【问题描述】:
我只是想让节点和 websockets 与 ASP.NET MVC 项目一起运行。 我在 Server 2012、IIS8、最新的 node.js 和 iisnode 上运行。为 IIS 启用了 Websocket,并且 .NET 4.0 MVC 项目运行良好。另外,我可以在独立于 IIS 的节点上运行 websockets(在单独的端口上)。
我下载了faye websocket 和dante example project 并安装了它。
当我没有禁用 websockets 时,我得到
Unable to establish WebSocket connection to ws://localhost/dante/server.js
当我禁用 websockets 时,无论是在 dante 还是 wwwroot 中,我都会得到
This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
我尝试在 wwwroot webconfig 中指定 overrideMode="Allow",但这似乎不起作用。
我也试过删除 wwwroot web.config 似乎没有什么区别。我还尝试关闭服务器上的防火墙(只是为了好玩),但这并没有改变任何东西。
感谢您的帮助和帮助。我愿意使用任何东西(例如 socket.io),但想继续在同一个端口上运行 ASP.NET MVC 和节点,以消除防火墙问题并避免使用多个服务器/域/等。
编辑: 跑步
c:\windows\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/webSocket
使 IIS 错误消失,但现在我仍然收到:
Unable to establish WebSocket connection to ws://localhost/dante/server.js/ws
WebSocket connection is closed.
我已经打开了一个问题here。
编辑 2:我从 Web 平台安装程序安装了 iisnode。显然,来自 WebPI 的版本是旧的。我需要从 Installing for IIS 7.x/8.x 下的 github 站点 here 获取最新信息。一旦我安装了最新版本,它就可以工作了! 这是太棒了!感谢 tjanczuk! :)
【问题讨论】:
标签: asp.net node.js websocket iisnode