webee / wamp.js

The Web Application Messaging Protocol for js.
MIT License
6 stars 9 forks source link

React Native socket connection #6

Open DevJett opened 6 years ago

DevJett commented 6 years ago

Hi there!

I'm trying to make a socket connection in react native but I'm getting 2 errors and the server says it successfully connected.

screen shot 2018-07-13 at 17 41 05 screen shot 2018-07-13 at 17 42 27

my code

     let connection = new wamp.Connection({ url: 'wss://api.socketApp.io/', realm: 'ziggsRealm', authmethods: ['jwt'] });
        connection.onopen = (session, detalis) => {
           session.subscribe('Channel', (data)=>console.log(data));
           console.log(session)
        };
        connection.open();
        wamp.debugOn();
        wamp.WAMP_STATUS;
        wamp.STATUS;

I was using autobahn in ReactJS and it works perfectly but unfortunatly, it doesn't support react native

In backend server i'm using SSL it's not a self-signed certificate and ReactPHP router

DevJett commented 6 years ago
screen shot 2018-07-14 at 23 14 00
mrsantran commented 6 years ago

Same:

https://github.com/webee/wamp.js/issues/6#issuecomment-405050311