简体   繁体   English

HTML5 Websockets服务器要求

[英]HTML5 Websockets Server Requirements

I have spent the whole of yesterday trying to get my head round HTML5 websockets, but am still a little confused about a few points: 我花了整整一天的时间试图让我的头脑围绕HTML5 websockets,但我仍然有点困惑几点:

  1. Do I need to install any further add ons to my apache server to run a websocket server? 我是否需要在我的apache服务器上安装任何进一步的附件才能运行websocket服务器?
  2. Is it possible to run websockets on a shared server setup without access to the server root? 是否可以在共享服务器设置上运行websockets而无需访问服务器根目录?
  3. Are websockets going to be supported by IE9, if not then is there any point working with them if there is such limited browser support? IE9是否支持websockets,如果没有,那么如果有这么有限的浏览器支持,是否有任何一点与它们一起使用? Should I look at polling techniques instead? 我应该看一下投票技巧吗?
  4. How does one go about running simultaneous websockets (eg multiple chat app instances) how is each one uniquely defined? 如何运行同时的websockets(例如多个聊天应用程序实例)如何唯一地定义?
  5. Is there a reliable fallback for browsers that don't support websockets? 对于不支持websockets的浏览器,是否有可靠的回退?

Hope someone out there can help me understand these points, very greateful! 希望有人在那里可以帮助我理解这些要点,非常有意义!

W. W.

Don't think of WebSockets as a web server plugin. 不要将WebSockets视为Web服务器插件。 WebSockets is a way to establish a (nearly) raw socket connection between a browser and something else. WebSockets是一种在浏览器和其他东西之间建立(几乎)原始套接字连接的方法。 There is some desire on the standards committee to allow web servers to easily forward WebSocket connections to their target service, however as of v76 of the protocol the WebSockets handshake is explicitly incompatible with HTTP setup (for vague security reasons). 标准委员会希望允许Web服务器轻松地将WebSocket连接转发到其目标服务,但是从协议的v76开始,WebSockets握手明显与HTTP设置不兼容(出于模糊的安全原因)。 This may change back in the future especially now that a serious security issue has been found in the v76 setup process. 这可能会在未来发生变化,尤其是在v76设置过程中发现了严重的安全问题。

Yes, the WebSockets handshake looks a lot like HTTP, so it's easy to get confused, but even when it was compatible with an HTTP Upgrade request, it was still just to enable easy forwarding by the web server, not so that the webserver could become a WebSockets server. 是的,WebSockets握手看起来很像HTTP,因此很容易混淆,但即使它与HTTP升级请求兼容,它仍然只是通过Web服务器实现轻松转发,而不是因为Web服务器可能变为WebSockets服务器。

There is a recent security issue in WebSockets which probably means most browser makers will disable WebSockets until the next version of the protocol is ready, but apart from that WebSockets is pretty much universally support because browsers without native support can use web-socket-js which is a Flash based fallback. WebSockets中存在最近的安全问题,这可能意味着大多数浏览器制造商将禁用WebSockets,直到协议的下一个版本准备就绪,但除了WebSockets之外几乎普遍支持,因为没有本机支持的浏览器可以使用web-socket-js是一个基于Flash的后备。 iOS 4.2 also has WebSockets support (although again, that may get disabled temporarily due to the security issue). iOS 4.2也支持WebSockets(尽管由于安全问题,可能会暂时禁用)。

So the answers to your questions are: 1) Mu 2) Yes 3) Unlikely 4) Not defined by WebSockets 5) Yes: see web-socket-js 因此,您的问题的答案是: 1)Mu 2)是3)不太可能4)WebSockets没有定义5)是:请参阅web-socket-js

Is there a reliable fallback for browsers that don't support websockets? 对于不支持websockets的浏览器,是否有可靠的回退?

Socket.IO seems to work well. Socket.IO似乎运行良好。 I haven't developed with it yet myself, but I've tested apps that use it with browsers that don't support WebSockets natively. 我还没有自己开发,但是我已经测试了使用它的应用程序与本身不支持WebSockets的浏览器。

For what it's worth, you may want to drop the HTML5 when talking about and/or researching this. 对于它的价值,您可能想在讨论和/或研究HTML5时放弃HTML5。 WebSockets are no longer part of HTML5. WebSockets不再是HTML5的一部分。 If you search for information on "HTML5 WebSockets", you're more likely to find dated info. 如果您搜索“HTML5 WebSockets”的信息,您更有可能找到过时的信息。

1) No. 2) Yes. 1)第2号)是的。 3) Who knows. 3)谁知道。 And Microsoft isn't saying, as usual, but probably not. 微软并没有像往常一样说,但可能不会。

Firefox, Chrome and Opera have all announced they will not support web sockets for now because the standard is incomplete and has security issues. Firefox,Chrome和Opera都宣布他们暂时不支持网络套接字,因为标准不完整且存在安全问题。 It may be too early to be messing with this right now. 现在搞这个可能为时尚早。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM