Autobahn|Cpp is an open-source networking library for C++ created by the Autobahn project that implements the Web Application Messaging Protocol (WAMP) for creating C++ components communicating with a WAMP router via Unix pipes.

Web Application Messaging Protocol (WAMP)

WAMP is ideal for distributed, multi-client and server applications, such as multi-user database-drive business applications, sensor networks (IoT), instant messaging or MMOGs (massively multi-player online games) .

WAMP enables application architectures with application code distributed freely across processes and devices according to functional aspects. Since WAMP implementations exist for multiple languages, WAMP applications can be polyglot. Application components can be implemented in a language and run on a device which best fit the particular use case.

To enable this, WAMP implements both the Remote Procedure Call (RPC) and and the Publish and Subscribe (PubSub) messaging pattern. WAMP is open source, as is Autobahn|Cpp (Apache 2.0 license).

Autobahn|Cpp supports the following application roles:

  • Caller
  • Callee
  • Publisher
  • Subscriber

Show me some code!

Here is what programming with C++ and Autobahn|Cpp looks like.

Calling a remote Procedure

auto c1 ="com.mathservice.add2", {23, 777})
   [&](future<any> f) {
      cout << "Got call result " << any_cast<uint64_t> (f.get()) << endl;

Registering a remoted Procedure

auto r1 = session.provide("com.myapp.cpp.square",
   [](const anyvec& args, const anymap& kwargs) {
      cout << "Procedure is invoked .." << endl;
      uint64_t x = any_cast<uint64_t> (args[0]);
      return x * x;
   [](future<registration> reg) {
      cout << "Registered with ID " << reg.get().id << endl;

Publishing an Event

session.publish("com.myapp.topic2", {23, true, string("hello")});

Publishing an Event (acknowledged)

auto opts = PublishOptions();
opts.acknowledge = True;

auto p1 = session.publish("com.myapp.topic2", {23, true, string("hello")}, opts)
   [](future<publication> pub) {
      cout << "Published with ID " << pub.get().id << endl;

Subscribing to a Topic

auto s1 = session.subscribe("com.myapp.topic1",
   [](const anyvec& args, const anymap& kwargs) {
      cout << "Got event: " << any_cast<uint64_t>(args[0]) << endl;
   [](future<subscription> sub) {
      cout << "Subscribed with ID " << sub.get().id << endl;

Here is JavaScript running in Chrome call into C++ running on command line. Both are connected via a WAMP router, in this case Autobahn|Python based.



To get Autobahn|Cpp library and examples, clone the repo

cd $HOME
git clone
cd AutobahnCpp

The library is “header-only”, means there isn’t anything to compile or build. Just include the relevant headers.


The API and implementation make use of modern C++ 11 and new asynchronous idioms using (upcoming) features of the standard C++ library, in particular Futures, Continuations and Lambdas.


Continuations are one way of managing control flow in an asynchronous program. Other styles include: asynchronous Callbacks, Coroutines (yield or await), Actors (Erlang/OTP, Scala/Akka or Rust) and Transactional memory.

Autobahn|Cpp supports running WAMP (rawsocket-msgpack) over TCP(-TLS), Unix domain sockets or pipes (stdio). The library is “header-only”, light-weight (< 2k code lines) and depends on the following:

Get in touch

Get in touch on IRC #autobahn on, follow us on Twitter or join the mailing list.

Indices and tables

Reactive Manifesto: We are reactive banner