Git Product home page Git Product logo

Comments (12)

jondubois avatar jondubois commented on September 23, 2024 1

@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.

jondubois avatar jondubois commented on September 23, 2024

@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.

jondubois avatar jondubois commented on September 23, 2024

@bikashsharmabks Also, what version of socketcluster and socketcluster-server are you using on the server side?

from socketcluster-client.

bikashsharmabks avatar bikashsharmabks commented on September 23, 2024

@jondubois

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.

jondubois avatar jondubois commented on September 23, 2024

@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.

bikashsharmabks avatar bikashsharmabks commented on September 23, 2024

@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.

bikashsharmabks avatar bikashsharmabks commented on September 23, 2024

@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.

jondubois avatar jondubois commented on September 23, 2024

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.

bikashsharmabks avatar bikashsharmabks commented on September 23, 2024

@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.

yogi9999999 avatar yogi9999999 commented on September 23, 2024

@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.

AustinHunt avatar AustinHunt commented on September 23, 2024

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.

AustinHunt avatar AustinHunt commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.