【问题标题】:Trouble getting iisnode and websockets working无法让 iisnode 和 websocket 正常工作
【发布时间】: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 websocketdante 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


    【解决方案1】:

    iisnode 从 0.2.0 版开始添加了对 websockets 的支持。确保使用来自https://github.com/tjanczuk/iisnode 的链接安装最新的 iisnode。

    【讨论】:

    • 您回复的很快,谢谢!我有点远,但仍然有一个问题。我已经更新了问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-05
    • 2017-11-06
    • 2011-09-06
    • 1970-01-01
    • 2023-03-10
    • 2020-10-16
    • 2014-01-15
    相关资源
    最近更新 更多