3 ms·
I'm using SockJS (client and server: https://github.com/sockjs/sockjs-client https://github.com/sockjs/sockjs-client) for project I'm working on, which does imp
by digisth 14y ago
I'm using SockJS (client and server: https://github.com/sockjs/sockjs-client https://github.com/sockjs/sockjs-client) for project I'm working on, which does implement a variety of fallback methods (iframe tricks, JSON polling, etc.) and it's been working pretty well (some work better than others.)
For those who to opt for these libs, I recommend the following for protocols/fallbacks:
protocols_whitelist:
['websocket',
'xhr-streaming',
'iframe-eventsource',
'iframe-htmlfile',
'xhr-polling',
'iframe-xhr-polling']
This gets you a working system in pretty much every modern browser supporting WS, and /usually/ works pretty well in IE8/9. Just try to avoid page refreshes in those two browsers (very spotty results if you don't - I'd recommend putting up a message for your users) and implement the workarounds for finicky browsers (things like catching ESC in Firefox.) I've been pretty happy with it so far.