Autobahn Libraries

The Autobahn project is maintained by the same people who created the open source Crossbar.io WAMP router.

It provides open-source implementations of the Web Application Messaging Protocol (WAMP) for a range of languages (as well as the industry-standard WebSocket test suite).

WAMP connects components in distributed applications using Publish and Subscribe (PubSub) and routed Remote Procedure Calls (rRPC). It is ideal for distributed, multi-client and server applications such as IoT applications or multi-user database-driven business applications.

You can contact us via

There are also numerous third-party implementations of WAMP clients - see Supported Languages.

Autobahn|Python

WAMP for Python 2 and 3 on Twisted and asyncio.

Also provides a WebSocket implementation for Python 2 and 3 (used by Mozilla for their Push API backend for Firefox).

Autobahn|JS

WAMP for JavaScript.

Runs in the browser and on Node.js.

Autobahn|CPP

WAMP for C++

Requires features of C++ 11 and uses boost libraries.

Autobahn|C

WAMP for C (under development)

Targeting embedded controllers and MCUs running RIOT OS. Talk WAMP across the entirety of your IoT application!

Autobahn|Java

WAMP and WebSocket for Java (under development)

Runs both on Android and Netty/JVM. (Modernized and extended successor to Autobahn|Android)

Autobahn|Testsuite

A testsuite for WebSocket implementations

Test your WebSocket implementation using the industry-standard tool.

Show me some code! ΒΆ

Here is what application components look like in the languages supported by Autobahn:

// 1) SUBSCRIBE to a topic to receive events
function onhello(args) {
   console.log("Got event:", args[0]);
}
session.subscribe('com.myapp.hello', onhello);

// 2) PUBLISH an event
session.publish('com.myapp.hello', ['Hello, world!']);

// 3) REGISTER a procedure for remote calling
function add2(args) {
   return args[0] + args[1];
}
session.register('com.myapp.add2', add2);

// 4) CALL a remote procedure
session.call('com.myapp.add2', [2, 3]).then(
   function (result) {
      console.log("Got result:", result);
   }
);
# 1) SUBSCRIBE to a topic to receive events
def onhello(msg):
   print("Got event: {}".format(msg))
session.subscribe(onhello, 'com.myapp.hello')

# 2) PUBLISH an event
session.publish('com.myapp.hello', 'Hello, world!')

# 3) REGISTER a procedure for remote calling
def add2(x, y):
   return x + y
session.register(add2, 'com.myapp.add2');

# 4) CALL a remote procedure
result = yield from session.call('com.myapp.add2', 2, 3)
print("Got result: {}".format(result))
// 1) SUBSCRIBE to a topic to receive events
void onhello(const anyvec& args, const anymap& kwargs) {
   cout << "Got event: " << any_cast<string>(args[0]) << endl;   
}
session.subscribe("com.myapp.hello", &onhello);

// 2) PUBLISH an event
session.publish("com.myapp.hello", {string("Hello, world!")});

// 3) REGISTER a procedure for remote calling
any add2(const anyvec& args, const anymap& kwargs) {
   return any_cast<uint64_t>(args[0]) + any_cast<uint64_t>(args[1]);
}
session.provide("com.myapp.add2", &add2);

// 4) CALL a remote procedure
session.call("com.mathservice.add2", {2, 3}).then(
   [&](future<any> f) {
      cout << "Got result: " << any_cast<uint64_t> (f.get()) << endl;
   }
);
Get
commercial support
for
Crossbar.io
Get commercial support for Crossbar.io