Hacker News new | ask | show | jobs
by cgbystrom 5071 days ago
I would strongly advise not to base your push mechanism solely on Web Sockets. Despite advances modern browsers are making with Web Sockets support, the current compatibility is not there yet.

For starters, IE has no support, though that is starting to change with IE10. But the biggest issue is with personal firewalls / corporate proxies. These are unfortunately quite horrible at handling Web Sockets. Many popular firewalls such as avast! and Bitdefender can’t handle the WS protocol and completely blocks traffic despite browser support and it being valid HTTP. The socket.io guys did some extensive research on what firewalls are causing these issues. I don’t think their list is exhaustive but it features most major personal firewalls out there. Have a look at https://github.com/LearnBoost/socket.io/wiki/Socket.IO-and-f... , it's no reading of joy.

I’ve deployed quite large installations of Beaconpush (a push server incidentally based on Netty as well). First going from Web Sockets with fallback, over to pure WS and we’re looking at going back to using fallbacks once again due to these incompatibility issues. This time we are looking at using SockJS instead of rolling our own (to be fair, there were no open-source libs doing this when we started). I’ve ported SockJS to Netty (https://github.com/cgbystrom/sockjs-netty) and it’s working although I wouldn’t say it is production ready.

I urge you to have a look at SockJS and socket.io. Personally I prefer SockJS since it aims at emulating the Web Socket interface and nothing more as compared to socket.io (which adds a pub/sub layer). Also, it does not rely on a Flash fallback (which is another story). The socket.io guys are however working on engine.io, which will split the transport fallback mechanisms of socket.io to a separate library. That's a good idea, but it still uses Flash and IMHO a more complex "transport upgrade".