webee / wamp.js

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

Doesn't connect when being used in react native #2

Open isaacagaba opened 7 years ago

isaacagaba commented 7 years ago

I have followed the instructions, fortunately, the app doesn't crash however anything happens.Here is my code is written in react native. ` import wamp from 'wamp.js'; var connection = new wamp.Connection({url: 'http://localhost:3009', realm: 'realm1'}); connection.onopen = function (session) {

      // 1) subscribe to a topic
      function onevent(args) {
          console.log("Event:", args[0]);
      }
      session.subscribe('onNewData', onevent);
  };

connection.open(); `

webee commented 7 years ago

@akaiz I simplified the implementation, only support WebSocket, so your url must be a ws url. furthermore, you can watch your wamp server log to see what happened when open.