WAMP provides asynchronous Remote Procedure Calls and
Publish & Subscribe for applications in one protocol
running over WebSocket.
WAMP is a routed protocol, so you need a WAMP Router to
connect your Autobahn|Python based clients. We provide
Crossbar.io, but there are
other options
as well.
Note
Autobahn|Python currently requires Python 3.11 or later. Earlier
release lines supported older Python versions: up to version v19.11.2
supported Python 2 and 3.4+, up to version v20.7.1 supported Python
3.5+, and up to version v21.2.1 supported Python 3.6+.
Features
framework for WebSocket
and WAMP clients and servers
IMPORTANT: A Note on Upcoming Policy Changes Regarding AI-Assisted Content
Up to and including release v25.6.1, this project contains no code
or documentation generated with the assistance of AI tools. This version
represents the final release under our historical contribution policy.
Starting with future versions (after release v25.6.1), our contribution policy
will change. Subsequent releases MAY contain code or documentation
created with AI assistance.
We urge all users and contributors to review our AI
Policy.
This document details:
The rules and warranties required for all future contributions.
The potential intellectual property implications for the project and
its users.
This policy was established following an open community discussion,
which you can review on GitHub issue
#1663.
We are providing this transparent notice to enable you to make an
informed decision. If our new AI policy is incompatible with your own
(or your organization's) development practices or risk tolerance, please
take this into consideration when deciding whether to upgrade beyond
version v25.6.1.
Show me some code
To give you a first impression, here are two examples. We have
lot more
in the repo.
WebSocket Echo Server
Here is a simple WebSocket Echo Server that will echo back any
WebSocket message received:
To actually run above server protocol, you need some lines of
boilerplate.
WAMP Application Component
Here is a WAMP Application Component that performs all four types
of actions that WAMP provides:
subscribe to a topic
publish an event
register a procedure
call a procedure
from autobahn.twisted.wamp import ApplicationSession
# or: from autobahn.asyncio.wamp import ApplicationSession
class MyComponent(ApplicationSession):
@inlineCallbacks
def onJoin(self, details):
# 1. subscribe to a topic so we receive events
def onevent(msg):
print("Got event: {}".format(msg))
yield self.subscribe(onevent, 'com.myapp.hello')
# 2. publish an event to a topic
self.publish('com.myapp.hello', 'Hello, world!')
# 3. register a procedure for remote calling
def add2(x, y):
return x + y
self.register(add2, 'com.myapp.add2')
# 4. call a remote procedure
res = yield self.call('com.myapp.add2', 2, 3)
print("Got result: {}".format(res))
Above code will work on Twisted and asyncio by changing a single
line (the base class of MyComponent). To actually run above
application component, you need some lines of
boilerplate
and a
WAMP Router.
no longer explicitly supports PyInstaller packaging
*: for commercial users, typedef int GmbH (Germany), original creator and active maintainer of Autobahn, Crossbar.io and WAMP provides production grade, optimized and supported Docker images based on RHEL 9 and Debian 12, including complete SBOM for both the base system and full Python application run-time environment based on CycloneDX v1.6 in JSON format and as a audit-level PDF/A document fulfilling strict cybersecurity requirements addressing e.g. EU CRA and BSI TR-03183.
Package Releases
Autobahn|Python publishes source distributions and pre-built wheels on
PyPI and
GitHub Releases.
The current release line requires Python 3.11 or later and publishes
wheels for CPython 3.11 through 3.14 and PyPy 3.11 across supported
Linux, macOS, and Windows targets.
The recommended installation method is:
python -m pip install autobahn
Pip will choose the best matching wheel for your Python implementation,
operating system, and CPU architecture. See the
wheels inventory
for the supported wheel matrix and NVX acceleration notes.
Extensions
Networking framework
Autobahn runs on both Twisted and asyncio. To select the
respective netoworking framework, install flavor:
asyncio: Backwards-compatible no-op. Asyncio is included in the
Python standard library for all supported Python versions.
twisted: Install Twisted and Twisted support in Autobahn
WebSocket Acceleration and Compression
Acceleration (Deprecated)
The accelerate optional dependency is no longer recommended. Autobahn now includes NVX (Native Vector Extensions), which provides SIMD-accelerated native code for WebSocket operations (XOR masking and UTF-8 validation) using CFFI. See the NVX section below for details.
accelerate: Deprecated - Use NVX instead
Compression
Autobahn supports multiple WebSocket per-message compression algorithms via the compress optional dependency:
Snappy compression is available but requires manual installation of python-snappy (no binary wheels):
pip install python-snappy # Requires libsnappy-dev system library
For most use cases, Brotli is recommended over Snappy due to better compression ratios and included binary wheels.
Encryption and WAMP authentication
Autobahn supports running over TLS (for WebSocket and all WAMP
transports) as well as WAMP-cryposign authentication.
To install use this flavor:
encryption: Installs TLS and WAMP-cryptosign dependencies
Autobahn also supports WAMP-SCRAM authentication. To install:
scram: Installs WAMP-SCRAM dependencies
Native vector extensions (NVX)
> This is NOT yet complete - ALPHA!
Autobahn contains NVX, a network accelerator library that
provides SIMD accelerated native vector code for WebSocket (XOR
masking) and UTF-8 validation.
NVX lives in namespace
autobahn.nvx and currently
requires a x86-86 CPU with at least SSE2 and makes use of
SSE4.1 if available. The code is written using vector
instrinsics, should compile with both GCC and Clang,and
interfaces with Python using CFFI, and hence runs fast on PyPy.
WAMP Serializers
The JSON, MessagePack, CBOR and FlatBuffers serializers are included by default - batteries included! UBJSON is available via the optional autobahn[serialization] extra.
Autobahn|Python ships with the following WAMP serializers:
The serializer dependencies are optimized for both CPython and PyPy:
Serializer
CPython
PyPy
Wheel Type
Notes
json
stdlib
stdlib
-
Always available
msgpack
Binary wheel (C extension)
u-msgpack-python (pure Python)
Native + Universal
PyPy JIT makes pure Python faster than C
ujson
Binary wheel
Binary wheel
Native
Available for both implementations
cbor2
Binary wheel
Pure Python fallback
Native + Universal
Binary wheels + py3-none-any
ubjson(optional)
C ext (from sdist)
❌ n/a (CPython only)
Source only — no wheels
Optional autobahn[serialization] extra (bjdata, pulls numpy). CPython-only: bjdata can't install on PyPy (NeuroJSON/pybj#6); on PyPy use cbor/msgpack. On CPython without a compiler set PYBJDATA_NO_EXTENSION=1
flatbuffers
Vendored
Vendored
Included
Always available, no external dependency
Key Design Principles:
Batteries Included: Core serializers (JSON, MessagePack, CBOR, FlatBuffers) available without extra install steps; UBJSON via the optional autobahn[serialization] extra
PyPy Optimization: Pure Python implementations leverage PyPy's JIT for superior performance
Binary Wheels: Native wheels for all major platforms (Linux x86_64/ARM64, macOS x86_64/ARM64, Windows x86_64)
Zero System Pollution: All dependencies install cleanly via wheels or pure Python
WAMP Compliance: Full protocol support out-of-the-box
Total Additional Size: ~590KB (negligible compared to full application install)
Platform Coverage
All serializer dependencies provide binary wheels for:
The serialization optional dependency is maintained for backwards compatibility:
pip install autobahn[serialization] # Still works, but now a no-op
ujson Acceleration
To speed up JSON on CPython using the faster ujson, set:
AUTOBAHN_USE_UJSON=1
Warning: Using ujson will break the ability of Autobahn to transport and translate binary application payloads in WAMP transparently. This ability depends on features of the standard library json module not available in ujson.
Recommendations
General use: JSON (stdlib) or CBOR
High performance: MessagePack or Flatbuffers
Strict standards: CBOR (IETF RFC 8949)
Zero-copy: Flatbuffers (for large payloads)
Dependency Analysis
Autobahn|Python is fully optimized for both CPython and PyPy with comprehensive binary wheel coverage.
All dependencies follow these design principles:
CFFI over CPyExt: All native extensions use CFFI for optimal PyPy compatibility
Binary Wheels First: Native wheels available for all major platforms
Zero System Pollution: No system libraries or build tools required for installation
Core Dependencies
Dependency
Purpose
CPython
PyPy
Wheel Coverage
Notes
txaio
Twisted/asyncio abstraction
Universal wheel
Universal wheel
✅ Excellent
Pure Python, works everywhere
cryptography
TLS, X.509, cryptographic primitives
Binary wheel (Rust+CFFI)
Binary wheel (Rust+CFFI)
✅ Excellent
40+ wheels per release
hyperlink
URL parsing
Universal wheel
Universal wheel
✅ Excellent
Pure Python
WAMP Serializers (Batteries Included)
All serializers except UBJSON are included by default in the base installation; UBJSON is an optional extra (pip install autobahn[serialization]):
Serializer
Purpose
CPython
PyPy
Wheel Coverage
Notes
json
JSON serialization
stdlib
stdlib
✅ Always available
Python standard library
msgpack
MessagePack serialization
msgpack (binary wheel)
u-msgpack-python (pure Python)
✅ Excellent
50+ wheels for CPython; PyPy JIT optimized
ujson
Fast JSON (optional)
Binary wheel
Binary wheel
✅ Excellent
30+ wheels; both implementations
cbor2
CBOR serialization (RFC 8949)
Binary wheel
Pure Python fallback
✅ Excellent
30+ binary wheels + universal fallback
bjdata
UBJSON serialization (optional)
C ext (from sdist)
❌ n/a (CPython only)
⚠️ sdist only — no wheels
autobahn[serialization] extra; pulls numpy. CPython-only: can't install on PyPy (NeuroJSON/pybj#6). On CPython without a compiler set PYBJDATA_NO_EXTENSION=1. For wheels-only/cross-arch/PyPy installs prefer cbor/msgpack
flatbuffers
Google Flatbuffers
Vendored
Vendored
✅ Perfect
Included in our wheel, zero external dependency
Optional: Twisted Framework
Available via pip install autobahn[twisted]:
Dependency
Purpose
CPython
PyPy
Wheel Coverage
Notes
zope.interface
Component architecture
Binary wheel
Binary wheel
✅ Excellent
40+ wheels
twisted
Async networking framework
Universal wheel
Universal wheel
✅ Excellent
Pure Python
attrs
Class attributes
Universal wheel
Universal wheel
✅ Excellent
Pure Python
Optional: WebSocket Compression
Available via pip install autobahn[compress]:
Compression Method
CPython
PyPy
Wheel Coverage
Standards
Notes
permessage-deflate
stdlib (zlib)
stdlib (zlib)
✅ Always available
RFC 7692
Python standard library
permessage-brotli
brotli (CPyExt)
brotlicffi (CFFI)
✅ Excellent
RFC 7932
40+ wheels (brotli), 20+ wheels (brotlicffi)
permessage-bzip2
stdlib (bz2)
stdlib (bz2)
✅ Always available
Non-standard
Python standard library
permessage-snappy
python-snappy (optional)
python-snappy (optional)
⚠️ No wheels
Non-standard
Manual install; requires libsnappy-dev
Recommendation: Use permessage-brotli for optimal compression with full binary wheel support.
Optional: Encryption & WAMP Authentication
Available via pip install autobahn[encryption]:
Dependency
Purpose
CPython
PyPy
Wheel Coverage
Notes
pyopenssl
TLS/SSL operations
Universal wheel
Universal wheel
✅ Excellent
Pure Python wrapper
service-identity
TLS service verification
Universal wheel
Universal wheel
✅ Excellent
Pure Python
pynacl
NaCl cryptography
Binary wheel (CFFI)
Binary wheel (CFFI)
✅ Excellent
30+ CFFI wheels
pytrie
Trie data structure
Universal wheel
Universal wheel
✅ Excellent
Pure Python
qrcode
QR code generation
Universal wheel
Universal wheel
✅ Excellent
Pure Python
base58
Base58 encoding
Universal wheel
Universal wheel
✅ Excellent
Pure Python
ecdsa
ECDSA signatures
Universal wheel
Universal wheel
✅ Excellent
Pure Python
Optional: WAMP-SCRAM Authentication
Available via pip install autobahn[scram]:
Dependency
Purpose
CPython
PyPy
Wheel Coverage
Notes
cffi
C Foreign Function Interface
Binary wheel
Binary wheel
✅ Excellent
40+ wheels including PyPy
argon2-cffi
Argon2 password hashing
Binary wheel (CFFI)
Binary wheel (CFFI)
✅ Excellent
30+ CFFI wheels including PyPy
passlib
Password hashing framework
Universal wheel
Universal wheel
✅ Excellent
Pure Python
Optional: Native Vector Extensions (NVX)
Available via pip install autobahn[nvx]:
Feature
Implementation
CPython
PyPy
Coverage
Notes
XOR Masking
SIMD via CFFI
✅ Yes
✅ Yes
✅ Excellent
Our own CFFI-based implementation
UTF-8 Validation
SIMD via CFFI
✅ Yes
✅ Yes
✅ Excellent
Our own CFFI-based implementation
NVX provides significant performance improvements for WebSocket operations using SIMD instructions through CFFI.
Platform Coverage Summary
Binary wheels available for:
Operating Systems: Linux (glibc/musl), macOS, Windows