title: WebSocket React Native
body: <p>I'm new to <code>react native</code> moved from <code>ReactJS</code> I thought I can use same packages as my previous pure <code>Reactjs</code> app but I was wrong.</p>
  
  <p>What I'm trying to do is to make a <code>websocket</code> connection. </p>
  
  <p>I'm recently using <a href="https://www.npmjs.com/package/autobahn" rel="nofollow noreferrer"><code>autobahnJS</code></a> package <code>WAMP2</code> in my ReactJS app but when I moved to react native it seems  <code>autobahnJS</code> doesn't support <code>react-native</code></p>
  
  <pre><code>connectToSocketFunction = () =&gt;{ // autobahn code
          let connection = new autobahn.Connection({ url: 'wss://api.example.com/websocket/', realm: 'Realm1', authmethods: ['jwt'] });
          connection.onopen = (session, detalis) =&gt; {
  
              session.subscribe('ChannelName', (data)=&gt;console.log(data));
          };
  </code></pre>
  
  <p>Anyone know how does react native make socket connection based on my code?</p>
  
  <p>I have tried <a href="https://www.npmjs.com/package/react-native-autobahnjs" rel="nofollow noreferrer">react-native-autobahnjs</a> doesn't work</p>