WebSockets: Stable and Ready for Developers
sitepoint.com
sitepoint.com
What helps is the very awesome Socket.io abstraction, just mention websockets and a bunch of fallbacks in the config and get coding.
Must say having JavaScript on the server, the client and the data store is a huge advantage as well from a programming context perspective!
Of course, hard to say its production ready for all kinds of web apps, you must still choose based on your specific situation.
Sure, it can be stable. And ready is kind of subjective. But the 'Use this, now' feeling I got from the title was quickly nowhere to be found.
That said: I liked the whole walkthrough and general depth of the article.
http://caniuse.com/#feat=websockets
I would love to use web sockets in my app to replace long polling but without IE/Android, it's a non-starter.
It's not rocket science.
(Mibbit has been using websocket in production for 2.5 years or so)
P.S. "It's not rocket science" snark completely uncalled for.
I've seen this statement, or similar, a few times. But, Comet servers use WebSockets. So, WebSockets are not an alternative to Comet. They are a transport technology that is better suited to the Comet paradigm, and building interactive web apps, than HTTP (Long-Polling, Streaming). Here's a diagram I create a while back which hopefully explains my point of view: http://i.stack.imgur.com/BOFC2.png
Spot-on about the benefits of WebSockets over HTTP-based solutions when it comes to efficiency. The HTTP connection limit was a problem a while back but I don't believe it is any more.
That's exactly what I thought and that's why SockJS is there: https://github.com/sockjs/sockjs-client
a) start using SockJS
b) wait until enough browsers supports it
c) drop SockJS.
SockJS has a websocket-like API so no need to do major code changes when you switch.</shameless plug>
Additionally, IE 10 supports WebSockets, and fallbacks exist- such as flash- to give support to earlier versions of IE.
"Production Ready", in this sense, means "finalized enough that you can feel secure about implementation", just like html5 and css 3. Should you rely on css 3 alone for old versions of IE? You need fallbacks, of course. But you can feel comfortable about implementing it (with progressive enhancement or graceful degredation) for support of less-able browsers.
I can't 100% confirm Chrome will become the default but Google are very pro WebSockets so it would be very strange for them not to support and encourage their use.
There are fallback options in place that mean WebSockets can be used on Android but that tends to mean Flash lite also has to be installed.
Unless you go with something like Socket.IO, WebSockets alone would never be a viable solution.
In the same way that a WebSocket library can fallback from a WebSocket connection to a HTTP-based connection it can also first try ws:// and then fallback to wss:// - it's what our library does. The potential problem here of course is that you need an SSL certificate. When using Pusher that's not a problem, because we've bought one, but when using your own hosted solution that might mean dishing out money that you'd rather not.
When it's a case of writing in a line in nginx.conf for a proxy bypass or commenting out an apache module then it will be ready. Using port HTTP/port 80 is one of websockets strengths.
See: http://www.leggetter.co.uk/real-time-web-technologies-guide#...
The most obvious option, and something I thought might have become part of the WebSocket API, is auto-reconnection. To reconnect you need to create another WebSocket object and reattach all your event listeners. So, I'm convinced that the majority of people who use WebSockets will have to write their own custom code for this and will probably put it in their own little library which wraps around using WebSocket objects.
More info in the comment here: http://www.sitepoint.com/websockets-stable-and-ready-for-dev...
Similarly, what does it take to support this on the server side? (in a *nix environment)