autobahn 25.10.1


pip install autobahn

  Latest version

Released: Oct 20, 2025

Project Links

Meta
Author: typedef int GmbH
Requires Python: >=3.11

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • No Input/Output (Daemon)

Framework
  • Twisted

Intended Audience
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Topic
  • Internet
  • Internet :: WWW/HTTP
  • Communications
  • System :: Distributed Computing
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules
  • Software Development :: Object Brokering

Autobahn|Python

WebSocket & WAMP for Python on Twisted and asyncio.

Version Test Docs


Quick Links: Source Code - Documentation - WebSocket Examples - WAMP Examples Community: Forum - StackOverflow - Twitter - IRC #autobahn/chat.freenode.net Companion Projects: Autobahn|JS - Autobahn|Cpp - Autobahn|Testsuite - Crossbar.io - WAMP

Introduction

Autobahn|Python is a subproject of Autobahn and provides open-source implementations of

for Python 3.7+ and running on Twisted and asyncio.

You can use Autobahn|Python to create clients and servers in Python speaking just plain WebSocket or WAMP.

WebSocket allows bidirectional real-time messaging on the Web and beyond, while WAMP adds real-time application communication on top of WebSocket.

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 up to version v19.11.2 supported Python 2 and 3.4+, and up to version v20.7.1 supported Python 3.5+, and up to version v21.2.1 supported Python 3.6+.

Features


AI Policy

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:

from autobahn.twisted.websocket import WebSocketServerProtocol
# or: from autobahn.asyncio.websocket import WebSocketServerProtocol

class MyServerProtocol(WebSocketServerProtocol):

    def onConnect(self, request):
        print("Client connecting: {}".format(request.peer))

    def onOpen(self):
        print("WebSocket connection open.")

    def onMessage(self, payload, isBinary):
        if isBinary:
            print("Binary message received: {} bytes".format(len(payload)))
        else:
            print("Text message received: {}".format(payload.decode('utf8')))

        # echo back message verbatim
        self.sendMessage(payload, isBinary)

    def onClose(self, wasClean, code, reason):
        print("WebSocket connection closed: {}".format(reason))

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:

  1. subscribe to a topic
  2. publish an event
  3. register a procedure
  4. 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.

Packaging

The Autobahn|Python OSS project:

*: 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 provides comprehensive binary wheel coverage for all major platforms and Python implementations.

Generic

  • Source distribution: autobahn-25.9.1.tar.gz
  • Pure Python 3 wheel: autobahn-25.9.1-py3-none-any.whl

Note: The pure Python wheel cannot include NVX (Native Vector Extensions) optimizations and will fall back to pure Python implementations. This provides maximum compatibility but slower performance compared to platform-specific wheels with native CFFI extensions.

Linux

Available for x86_64 architecture with native CFFI extensions:

  • autobahn-25.9.1-cp311-cp311-linux_x86_64.whl
  • autobahn-25.9.1-cp312-cp312-linux_x86_64.whl
  • autobahn-25.9.1-cp313-cp313-linux_x86_64.whl
  • autobahn-25.9.1-cp314-cp314-linux_x86_64.whl
  • autobahn-25.9.1-pp311-pypy311_pp73-linux_x86_64.whl

macOS

Available for Apple Silicon (ARM64) architecture:

  • autobahn-25.9.1-cp312-cp312-macosx_15_0_arm64.whl
  • autobahn-25.9.1-cp313-cp313-macosx_15_0_arm64.whl
  • autobahn-25.9.1-cp314-cp314-macosx_11_0_arm64.whl
  • autobahn-25.9.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl

Windows

Available for x86_64 (AMD64) architecture:

  • autobahn-25.9.1-cp311-cp311-win_amd64.whl
  • autobahn-25.9.1-cp312-cp312-win_amd64.whl
  • autobahn-25.9.1-cp313-cp313-win_amd64.whl
  • autobahn-25.9.1-cp314-cp314-win_amd64.whl
  • autobahn-25.9.1-pp311-pypy311_pp73-win_amd64.whl

All wheels include native CFFI extensions for optimal performance and are available from PyPI and GitHub Releases.

Extensions

Networking framework

Autobahn runs on both Twisted and asyncio. To select the respective netoworking framework, install flavor:

  • asyncio: Install asyncio (when on Python 2, otherwise it's included in the standard library already) and asyncio support in Autobahn
  • twisted: Install Twisted and Twisted support in Autobahn

WebSocket acceleration and compression

  • accelerate: Install WebSocket acceleration - Only use on CPython - not on PyPy (which is faster natively)
  • compress: Install (non-standard) WebSocket compressors bzip2 and snappy (standard deflate based WebSocket compression is already included in the base install)

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

  • serialization: To install additional WAMP serializers: CBOR, MessagePack, UBJSON and Flatbuffers

Above is for advanced uses. In general we recommend to use CBOR where you can, and JSON (from the standard library) otherwise.


To install Autobahn with all available serializers:

pip install autobahn[serializers]

or (development install)

pip install -e .[serializers]

Further, to speed up JSON on CPython using ujson, set the environment variable:

AUTOBAHN_USE_UJSON=1

Warning

Using ujson (on both CPython and PyPy) will break the ability of Autobahn to transport and translate binary application payloads in WAMP transparently. This ability depends on features of the regular JSON standard library module not available on ujson.

25.10.1 Oct 20, 2025
25.9.1 Oct 15, 2025
24.4.2 Aug 02, 2024
23.6.2 Jun 14, 2023
23.6.1 Jun 04, 2023
23.1.2 Feb 08, 2023
23.1.1 Jan 15, 2023
22.12.1 Dec 18, 2022
22.7.1 Aug 02, 2022
22.6.1 Jul 05, 2022
22.5.1 Jun 02, 2022
22.4.2 May 04, 2022
22.4.1 May 04, 2022
22.3.2 Mar 27, 2022
22.3.1 Mar 26, 2022
22.2.2 Feb 24, 2022
22.2.1 Feb 23, 2022
22.1.1 Jan 28, 2022
21.11.1 Nov 21, 2021
21.3.1 Mar 02, 2021
21.2.2 Feb 26, 2021
21.2.1 Feb 11, 2021
21.1.1 Feb 06, 2021
20.12.3 Dec 19, 2020
20.12.2 Dec 14, 2020
20.12.1 Dec 13, 2020
20.7.1 Jul 17, 2020
20.6.2 Jun 29, 2020
20.6.1 Jun 11, 2020
20.4.3 Apr 22, 2020
20.4.2 Apr 14, 2020
20.4.1 Mar 31, 2020
20.3.1 Mar 03, 2020
20.2.2 Feb 25, 2020
20.2.1 Feb 07, 2020
20.1.3 Jan 24, 2020
20.1.2 Jan 14, 2020
19.11.2 Jan 09, 2020
19.11.1 Nov 07, 2019
19.10.1 Sep 30, 2019
19.9.3 Sep 09, 2019
19.9.2 Aug 29, 2019
19.9.1 Aug 28, 2019
19.8.1 Aug 01, 2019
19.7.2 Jul 24, 2019
19.7.1 Jul 08, 2019
19.6.2 Jun 06, 2019
19.6.1 Jun 05, 2019
19.5.1 May 12, 2019
19.3.3 Mar 24, 2019
19.3.2 Mar 18, 2019
19.3.1 Mar 18, 2019
19.2.1 Feb 14, 2019
19.1.1 Jan 10, 2019
18.12.1 Dec 17, 2018
18.11.2 Nov 22, 2018
18.11.1 Nov 06, 2018
18.10.1 Oct 20, 2018
18.9.2 Sep 10, 2018
18.9.1 Sep 02, 2018
18.8.2 Aug 31, 2018
18.8.1 Aug 19, 2018
18.7.1 Jul 28, 2018
18.6.1 Jun 07, 2018
18.5.2 May 26, 2018
18.5.1 May 09, 2018
18.4.1 Apr 09, 2018
18.3.1 Mar 05, 2018
17.10.1 Oct 31, 2017
17.9.3 Sep 24, 2017
17.9.2 Sep 12, 2017
17.9.1 Sep 04, 2017
17.8.1 Aug 15, 2017
17.7.1 Jul 21, 2017
17.6.2 Jun 24, 2017
17.6.1 Jun 08, 2017
17.5.1 May 01, 2017
0.18.2 Apr 15, 2017
0.18.1 Mar 28, 2017
0.18.0 Mar 26, 2017
0.17.2 Feb 25, 2017
0.17.1 Dec 29, 2016
0.17.0 Nov 30, 2016
0.16.1 Nov 07, 2016
0.16.0 Aug 14, 2016
0.15.0 Jul 19, 2016
0.14.1 May 26, 2016
0.14.0 May 01, 2016
0.13.1 Apr 09, 2016
0.13.0 Mar 15, 2016
0.12.1 Jan 30, 2016
0.11.0 Dec 09, 2015
0.10.9 Sep 15, 2015
0.10.8 Sep 13, 2015
0.10.7 Sep 06, 2015
0.10.6 Sep 05, 2015
0.10.5.post2 Aug 09, 2015
0.10.5 Aug 06, 2015
0.10.4 May 08, 2015
0.10.3 Apr 14, 2015
0.10.2 Mar 19, 2015
0.10.1 Mar 01, 2015
0.10.0 Feb 19, 2015
0.9.6 Feb 13, 2015
0.9.5 Jan 11, 2015
0.9.4.post2
0.9.4 Dec 15, 2014
0.9.3.post3
0.9.3.post2
0.9.3 Nov 10, 2014
0.9.2 Oct 17, 2014
0.9.1 Sep 22, 2014
0.9.0 Sep 02, 2014
0.8.15 Aug 23, 2014
0.8.14 Aug 14, 2014
0.8.13 Aug 05, 2014
0.8.12 Jul 23, 2014
0.8.11 Jul 15, 2014
0.8.10 Jun 24, 2014
0.8.9 May 28, 2014
0.8.8 Apr 11, 2014
0.8.7 Apr 01, 2014
0.8.6 Mar 20, 2014
0.8.5 Mar 13, 2014
0.8.4.post3
0.8.4.post2
0.8.4 Mar 03, 2014
0.8.3 Mar 01, 2014
0.8.2 Feb 24, 2014
0.8.1 Feb 07, 2014
0.8.0 Jan 30, 2014
0.7.4 Jan 11, 2014
0.7.3 Jan 07, 2014
0.7.2 Jan 05, 2014
0.7.1 Jan 04, 2014
0.7.0 Jan 01, 2014
0.6.5 Nov 22, 2013
0.6.4 Oct 21, 2013
0.6.3 Oct 05, 2013
0.5.14 Feb 25, 2013
0.5.9 Oct 22, 2012
0.5.8 Sep 07, 2012
0.5.5 Jul 23, 2012
0.5.2 Jun 06, 2012
0.5.1 Mar 27, 2012
0.5.0 Mar 21, 2012
0.4.10 Dec 13, 2011
0.4.3 Oct 30, 2011
0.4.2 Sep 12, 2011
0.4.1 Aug 30, 2011
0.4.0 Aug 28, 2011
0.3.2 Aug 17, 2011
0.3.1 Aug 14, 2011
0.6.5.win32 Nov 22, 2013
0.6.4.win32 Oct 21, 2013
0.6.3.win32 Oct 05, 2013
0.5.9.win32 Oct 22, 2012
0.5.8.win32 Sep 07, 2012
0.5.5.win32 Jul 23, 2012
0.5.2.win32 Jun 06, 2012
0.5.14.win32 Feb 25, 2013
0.5.1.win32 Mar 27, 2012
0.5.0.win32 Mar 21, 2012
0.4.3.win32 Oct 30, 2011
0.4.2.win32 Sep 12, 2011
0.4.10.win32 Dec 13, 2011
0.4.1.win32 Aug 30, 2011
0.4.0.win32 Aug 28, 2011
0.3.2.win32 Aug 17, 2011
0.3.1.win32 Aug 14, 2011

Wheel compatibility matrix

Platform CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14 PyPy 3.11 (pp73)
macosx_11_0_arm64
macosx_15_0_arm64
manylinux1_x86_64
manylinux2014_aarch64
manylinux_2_17_aarch64
manylinux_2_28_aarch64
manylinux_2_34_x86_64
manylinux_2_5_x86_64
win_amd64

Files in release

Extras:
Dependencies:
txaio (>=25.9.2)
cryptography (>=3.4.6)
hyperlink (>=21.0.0)
importlib-resources (>=5.0.0)