Advertisement
Guest User

Autobahn WAMP client

a guest
May 2nd, 2014
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var connection = new autobahn.Connection({
  2.    url: 'ws://myhostname:8080',
  3.    realm: 'tutorialpubsub'}
  4. );
  5.  
  6. connection.onopen = function (session) {
  7.  
  8.    function onevent(args) {
  9.       console.log(args);
  10.    }
  11.  
  12.    session.subscribe('com.myapp.topic1', onevent).then(
  13.       function(subscription) {
  14.          console.log("subscription successfull", subscription);
  15.       },
  16.       function(error) {
  17.          console.log("subscription failed", error);
  18.       }
  19.    );
  20.  
  21. };
  22.  
  23. connection.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement