【问题标题】:How do I implement COMET on Azure with Node.JS?如何使用 Node.JS 在 Azure 上实现 COMET?
【发布时间】:2012-02-11 20:13:34
【问题描述】:

既然 Microsoft ported Node.JS to Azure 在此平台上启用 COMET,接下来我需要做什么?

另外,这是托管服务器的正确方法吗?

var sys = require('util'), 
   http = require('http');
http.createServer(function (req, res) {
  setTimeout(function () {
    res.setHeader("200", {'Content-Type': 'text/plain'});
    res.write('Hello World');
    res.end();
  }, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');

【问题讨论】:

    标签: javascript node.js azure comet


    【解决方案1】:

    您可以使用socket.io 模块。长轮询和 websocket 绑定都将在 Azure 辅助角色中工作。在网络角色中,您只能进行长轮询。

    【讨论】:

    • 更具体地说,Web 角色在 IIS 和 websockets 上运行,而 IIS 还不能很好地结合在一起。
    • @Raynos - 我现在正在与 MSFT 合作。能否详细说明已知问题?
    • @makerofthings7 据我所知,已知问题是我上次查看时 IIS 和 websockets 需要 .NET 4.5。在撰写本文时,这只是关于 IIS 不支持 websockets 的评论。不知道现在是什么状态。
    猜你喜欢
    • 2010-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-29
    • 2011-01-16
    • 2011-01-27
    相关资源
    最近更新 更多