Html 哪些流行的网络服务器支持 HTML5 WebSocket?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2924991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What popular webservers have support for HTML5 WebSocket?
提问by Jonas
I would like to experiment with HTML5 WebSockets, and I am looking for a mature webserver with support for websockets. Is there a list of webservers that support websockets per default? What popular webservers has support for websockets out of the box?The server programming language doesn't matter, I know Java, PHP, Erlang, Python and more... I just want to do some small experiments.
我想尝试使用 HTML5 WebSockets,并且我正在寻找一个支持 websockets 的成熟网络服务器。是否有默认支持 websockets 的网络服务器列表?哪些流行的网络服务器开箱即用地支持 websockets?服务器编程语言无所谓,我懂Java、PHP、Erlang、Python等等……我只是想做一些小实验。
I have looked at a few that doesn't support websockets (yet), i.e. Nginx, Apache and Mochiweb.
我看过一些不支持 websockets 的(还),即 Nginx、Apache 和 Mochiweb。
采纳答案by natevw
Nowadays node.js, especially in conjuction with the Socket.IOlibrary, is a popular platform for WebSocket experiments. It's not a traditional "webserver" like Apache/nginx but it certainly offers a "server programming language" that's super easy to set up for small experiments and is possible to deploy in production too.
现在node.js,特别是与Socket.IO库结合使用,是 WebSocket 实验的流行平台。它不是像 Apache/nginx 这样的传统“网络服务器”,但它确实提供了一种“服务器编程语言”,它非常容易为小型实验设置,也可以在生产中部署。
回答by raffel
You can find a mod_websocket module for lighttpd here. I've tested it with lighttpd 1.4.26.
您可以在此处找到用于 lighttpd 的 mod_websocket 模块。我已经用 lighttpd 1.4.26 测试过了。
When building mod_websocket, be sure to specify the correct websocket protocol version you want to use (version -75 or -76). Starting with WebKit nightly build r59903 and Chrome 6.0.414.0 (r47952) only protocol version -76 is supported.
构建 mod_websocket 时,请务必指定要使用的正确 websocket 协议版本(版本 -75 或 -76)。从 WebKit nightly build r59903 开始,Chrome 6.0.414.0 (r47952) 仅支持协议版本 -76。
回答by Maciek Sawicki
http://en.wikipedia.org/wiki/Web_Sockets#Server_Implementations
http://en.wikipedia.org/wiki/Web_Sockets#Server_Implementations
I tested netty. It seems to work, but I need to play with it a little more to be sure if it's good solution.
我测试了netty。它似乎有效,但我需要多玩一点才能确定它是否是好的解决方案。
回答by BalusC
回答by bennedich
I just tried out tornado web serverand I'm really satisfied. You will easily get up and running in no time.
我刚刚尝试了龙卷风网络服务器,我真的很满意。您将立即轻松启动并运行。
回答by Derek Mahar
Apache Tomcat 7and later versions supportWebSocket.