react-native-autobahnjs

0.1.6 • Public • Published

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();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.6
    1
    • latest

Version History

Package Sidebar

Install

npm i react-native-autobahnjs

Weekly Downloads

1

Version

0.1.6

License

MIT

Last publish

Collaborators

  • emstevenli