Comments (3)
I just found this:
http://caniuse.com/#feat=websockets
Turns out that some mandatory browsers, such as Android 4.x, don't support WebSockets. IE usage is small, luckily. But due to the Android version fragmentation, and the fact that most of the phones can't even update to 4.4...is an issue. I'd therefore suggest some alternative transport methods in general.
from socketcluster-client.
@IngwiePhoenix if you need to support older browsers, you can use SC1 instead of the default version of SocketCluster (SC2). SC1 is fully compatible with SC2 so you don't have to change your code when you decide to migrate from SC1 to SC2 when you feel the time is right.
SC1 is still receiving regular updates and is in a completely separate branch, to install, use:
npm install -g sc1
then sc1 create someapp
Alternatively (and this is probably better); you can use SC2 with a Flash Socket fallback. In this case, you can add the fallback/polyfill yourself, see: https://github.com/gimite/web-socket-js - I haven't tried it myself so please let me know how it goes if you do go down that path. Note that you will have to include the provided flash socket scripts before your SocketCluster client script.
The reason why SC2 avoids using a polling fallback is because it doesn't scale well. Simulating a single socket using multiple HTTP connections is really bad when you start to scale across multiple processes or machines/instances - You end up with issues where the handshake begins on one process and tries to complete on a different process which knows nothing about the first part of the handshake (which causes rejection).
Because of this, using a polling fallback makes load balancing difficult (requires sticky-session TCP load balancing). WebSocket and Flash Socket are much more elegant because the entire flow starting with the initial handshake until the final close packet is done using a single connection.
Mechanisms which use polling as a fallback are essentially hacks. See http://12factor.net/processes
from socketcluster-client.
https://github.com/sockjs/sockjs-client/wiki/%5BArticle%5D-SockJS:-WebSocket-emulation-done-right
This looks and sounds interesting. I read through the source code slightly and it actually is
- Very lightweight.
- Very easy!
The article gives a good image of what this is and how it is ment to be used. I gotta say, this is really interesting.
I will see if the flash-fallback you suggested will work. But SockJS might be a good alternative. It's "emulation" doesn't add up too much code either.
from socketcluster-client.
Related Issues (20)
- socketCluster client on the backend
- Increases temperature on ios devices HOT 2
- TypeError: cb is not a function HOT 8
- Update release Page HOT 1
- Not able to run the client on the office-js in excel desktop HOT 2
- Subscribe method causes error in IE11 HOT 9
- TypeError: _iterator[Symbol.iterator] is not a function || For await of loop not working on Mobile (React Native) HOT 2
- Please bump version of remote socketcluster-client
- Remove gulp, and babel dependencies
- Can this client be used in non browser environment ?
- [docs] Add description about `autoReconnectOptions` option
- Unable to resolve as a es module
- Need help for implemeting a real-time chat HOT 1
- Incorrect disconnect code HOT 1
- socketcluster-client with protocol v1 HOT 1
- How to use "subscribeWildcard" instead of "subscribe" ? HOT 1
- How we add headers in socketclusterclient HOT 5
- I got TypeError: Object is not async iterable error while trying to listen to message event in React Native app
- Docs & readme incorrect on "rejectUnauthorized" HOT 3
- eventObject timeout has a timeout set when it's not expecting a response
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socketcluster-client.