Skip to content

Instantly share code, notes, and snippets.

@johngeorgewright
Created March 5, 2015 11:55
Show Gist options
  • Save johngeorgewright/b6a410528bb93c245180 to your computer and use it in GitHub Desktop.
Save johngeorgewright/b6a410528bb93c245180 to your computer and use it in GitHub Desktop.
Autobahn
import {Connection} from 'autobahn';
var connection = new Connection({
url: 'ws://127.0.0.1:8080/ws',
realm: 'realm1',
use_es6_promises: true
});
connection.onopen = (session) => {
session.subscribe('com.myapp.page', (args) => {
console.log(args);
// Store data in database
});
};
connection.open();
global.AUTOBAHN_DEBUG = true;
require('babel/register');
require('./app.es');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment