Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  1. Do I need to install any further add ons to my apache server to run a websocket server?
  2. Is it possible to run websockets on a shared server setup without access to the server root?
  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? 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?
  5. Is there a reliable fallback for browsers that don't support websockets?

Hope someone out there can help me understand these points, very greateful!

W.

like image 869
wilsonpage Avatar asked Dec 10 '10 10:12

wilsonpage


1 Answers

Don't think of WebSockets as a web server plugin. WebSockets is a way to establish a (nearly) raw socket connection between a browser and something else. 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). This may change back in the future especially now that a serious security issue has been found in the v76 setup process.

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.

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. iOS 4.2 also has WebSockets support (although again, that may get disabled temporarily due to the security issue).

So the answers to your questions are: 1) Mu 2) Yes 3) Unlikely 4) Not defined by WebSockets 5) Yes: see web-socket-js

like image 60
kanaka Avatar answered Nov 15 '22 13:11

kanaka