我需要node.js来监听socket.io请求吗?
我正在阅读一些有关socket.io 和node.js 的信息。问题是node.js的稳定版本在Linux上运行,但我的服务器不是Linux机器,可能无法运行cygwin.exe来运行node.js。
是否可以使用asp.net服务器创建套接字并监听socket.io?
I am reading some information about socket.io and node.js. The problem is that the stable version for node.js is run on linux but my server isn't a linux machine and may not be able to run cygwin.exe to run the node.js.
Is it possible to use asp.net server to create a socket and listen to the socket.io?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。 socket.io-client 与后端无关(它使用 node.js 来构建和测试它,但存储库有一个 dist 目录)。它甚至不需要 WebSocket 或 Flash Socket,尽管它们可以提高性能。
不幸的是我找不到已经构建的 ASP.net 后端。不过,我确实为 Django 找到了这个: http://pypi.python.org/pypi/ django-socketio/
这是连接代码:https://github.com/stephenmcd/django-socketio/blob/master /django_socketio/views.py 似乎只支持XHR轮询。
因此,这将是更多的工作。我认为在node.js和ASP.net之间建立通信并使用node.js与浏览器通信会容易得多。
编辑:我发现了一个支持更多协议的Java socket.io服务器。它基于netty,运行在windows上。 https://github.com/ibdknox/socket.io-netty
No. socket.io-client is backend-agnostic (it uses node.js to build and test it, but the repo has a dist directory). It doesn't even require WebSockets or Flash Sockets, though they make performance better.
Unfortunately I couldn't find a backend for ASP.net that's already built. I did find this one for Django, though: http://pypi.python.org/pypi/django-socketio/
Here is the connection code: https://github.com/stephenmcd/django-socketio/blob/master/django_socketio/views.py It seems to only support XHR polling.
So, it will be a lot more work. I think it would be a lot easier to set up communication between node.js and ASP.net and use node.js to communicate with browsers.
Edit: I found a Java socket.io server that supports more protocols. It's based on netty, which runs on windows. https://github.com/ibdknox/socket.io-netty