Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    react-native-autobahnjspublic

    React-native AutobahnJS

    React-native AutobahnJS is based on AutobahnJS,implements the WAMP protocal in react-native environment.

    WAMP provides asynchronous Remote Procedure Calls and Publish & Subscribe for applications in one protocol running over WebSocket.

    AutobahnJS is part of the Autobahn project, MIT licensed, and full source code can be found on GitHub.

    Code Example:

    var autobahn = require('react-native-autobahnjs');
    var WEBSOCKET_API_URL = 'wss://your-websocket/';
    var FALLBACK_API_URL = 'https://your-fallback/';
    var DOMAIN_PREFIX = 'http://your-domain-prefix';
    var React = require('react-native');
    var connection = new autobahn.Connection({
    	transports: [{
    		type: 'mobile', //type must be mobile in react-native
    		url: WEBSOCKET_API_URL,
    		fallback: FALLBACK_API_URL
    	}],
    	realm: DOMAIN_PREFIX
    });
    connection.onopen = function (session) {
    	//on open.
    };
    connection.onclose = function () {
    	//on close.
    };
    connection.open();
    

    Keywords

    none

    install

    npm i react-native-autobahnjs

    Downloadsweekly downloads

    14

    version

    0.1.6

    license

    MIT

    last publish

    collaborators

    • avatar