Comments (12)
@NomadGraphix There is no protocol
option, there is a secure
(boolean) option though. See the list of supported options here: http://socketcluster.io/#!/docs/api-socketcluster-client
from socketcluster-client.
@bikashsharmabks What options do you pass to socketCluster.connect(...)
? Did does it work with v5.0.14
?
I tested it v5.0.17
on RN iOS yesterday and it worked for me - So maybe it's related to settings.
from socketcluster-client.
@bikashsharmabks Also, what version of socketcluster
and socketcluster-server
are you using on the server side?
from socketcluster-client.
Version Details:
socketcluster": 5.0.18
Here is the code which I have
var options = {
hostname: 'dev.sandbox.com',
path: '/mySocketEventCluster',
port: 80,
}
this.socket = socketCluster.connect(options);
this.socket.on('connect', function (err) {
console.log('CONNECTED');
//Alert.alert('hi','connected');
});
this.socket.on('error', function (err) {
console.log(err);
//Alert.alert('err', err.message);
});
Note this works in browser, RN Android but not in RN iOS
from socketcluster-client.
@bikashsharmabks Maybe try to setup a very simple app (from scratch) with only basic SC logic to connect and emit/publish events and let me know if it works. We need to rule out the possibility that this is caused by some other code which is interfering with SC like middleware...
Yesterday I did a very simple test with socketcluster-client v5.0.17 and it was connecting, publishing and receiving messages with socketcluster v5.0.18 on the server side - It was running on iOS simulator on Mac.
from socketcluster-client.
@jondubois It worked I took a sample code from socketcluster getting started and it worked for RN iOS!!!
But still wondering what is issue with my configuration as it works with Android and browser and not with iOS
from socketcluster-client.
@jondubois I got the issue I was setting wsEngine to 'ws' which is not workging for iOS and when I change it to 'uws' it worked!!!
so is there any issue with 'ws'?
from socketcluster-client.
Interesting, on RN iOS on the client side, it will use the native WebSocket object provided by RN which in theory should be compatible with both ws and uws on the server, but maybe this is not the case, I'll have to check.
from socketcluster-client.
@jondubois thanks a lot for your help.
Please go ahead and close this issue or otherwise if you want to track the wsengine issue with this one
from socketcluster-client.
@bikashsharmabks it would be really help full if you tell me how you configured the socket cluster client in react native android.
from socketcluster-client.
This does not work in react-native iOS for protocol:HTTPS port:443 server. Trying secure ws connections hasn't worked for me, but it works using localhost. Please advise.
from socketcluster-client.
@jondubois Well, that is quite interesting. 👍
@yogi9999999, @bikashsharmabks The documentation looks to be lacking on github: https://github.com/SocketCluster/socketcluster-client
This is what I was using, but it is out of date.
var options = {
protocol: 'https',
hostname: 'example.com',
port: 443
};
// Initiate the connection to the server
var socket = socketCluster.connect(options);
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.