Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

autobahn-js

> 前端框架
Open source

WAMP in JavaScript for Browsers and NodeJS

1.4K stars0 likes0 views
WebsiteGitHub

About

WAMP in JavaScript for Browsers and NodeJS

Autobahn|JS

WAMP for Browsers and NodeJS. npm quicklinks:

  • autobahn - Autobahn for NodeJS
  • autobahn-browser - Autobahn for browsers
  • autobahn-xbr - Autobahn-XBR for NodeJS
  • autobahn-xbr-browser - Autobahn-XBR for browsers

XBR quicklinks:

  • XBR Network - The XBR Network homepage.
  • XBR Protocol - The XBR Protocol source repository.
  • XBR Docs - XBR Protocol and APIs Documentation.

Autobahn|JS is a subproject of the Autobahn project and provides an open-source implementation of the Web Application Messaging Protocol V2 in JavaScript under the MIT license.

WAMP provides asynchronous Remote Procedure Calls and Publish & Subscribe for applications in one protocol running over WebSocket (and fallback transports for old browsers).

Autobahn|JS runs on both Web browsers and Node.js.

Platform Requirements

Autobahn|JS targets:

  • Node.js 22+ (uses native WebSocket, no external dependencies)
  • Modern browsers: Chrome, Firefox, Edge, Safari (all current versions)

For older Node.js versions (< 22), use AutobahnJS v20.x which includes the ws library.

What can I do with this stuff?

Autobahn|JS makes distributed, realtime Web applications easy: it provides the infrastructure for both distributing live updates to all connected clients (using the PubSub messaging pattern) and for calling remote procedures in different backend components (using RPC).

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

The protocol that Autobahn|JS uses, WAMP, enables application architectures with application code distributed freely across processes and devices according to functional aspects. All WAMP clients are equal in that they can publish events and subscribe to them, can offer a procedure for remote calling and call remote procedures.

Since WAMP implementations exist for multiple languages, this extends beyond JavaScript clients: 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. Applications can span the range from embedded IoT sensors right to mobile clients or the browser - using the same protocol.

Show me some code

The following example implements all four roles that Autobahn|JS offers

  • Publisher
  • Subscriber
  • Caller (calls a remote procedure)
  • Callee (offers a remote procedure)

The code runs unaltered in the browser or Node.js!

…

Features

  • supports WAMP v2, works with any WAMP server
  • works both in the browser and Node.js
  • provides asynchronous RPC and PubSub messaging patterns
  • uses WebSocket or HTTP long-poll as transport
  • easy to use Promise-based API
  • pluggable promises/deferreds: uses when.js (built-in) with progress support for WAMP progressive calls
  • minimal dependencies (when.js for promises, CryptoJS for WAMP-CRA auth)
  • small size (~250kB source, ~110kB minified, ~35kB gzipped)
  • Open-Source (MIT License)

Get it

Browser Development

The latest built release of AutobahnJS can be retrieved by cloning this repository. You can then host the library wherever you need to.

This also contains a complete history of previous releases and can be used with Bower. To install:

bower install autobahn

Node.js Development

AutobahnJS is available via npm here. To install:

bash
npm install autobahn

Supported Node.js Versions

AutobahnJS is tested and supported on the following Node.js versions:

Version Status Support Until
22.x Maintenance LTS Apr 2027
24.x Active LTS "Krypton" Apr 2028
25.x Current —

Recommendation: Use Node.js 24.x (Active LTS) for production deployments.

For the latest Node.js release schedule, see nodejs.org/about/previous-releases.

WebSocket Support

Node.js 22+ includes native WebSocket support. AutobahnJS uses this native implementation directly—no external WebSocket library is required.

Quick Check

Verify your installation:

bash
node -e "var autobahn = require('autobahn'); console.log('AutobahnJS version:', autobahn.version);"

More information

For more information, take a look at the project documentation. This provides:

  • a quick 'Getting Started'
  • a basic introduction to programming with Autobahn|JS
  • a list of all examples in this repo
  • a full API reference

Get in touch

Get in touch on our user forum.

Acknowledgements

Autobahn|JS includes code from the following open-source projects

  • when.js — Promise/A+ implementation with progress support
  • CryptoJS — Cryptographic functions for WAMP-CRA

Special thanks to the Coders with an Unhealthy Javascript Obsession for creating when.js - A lightweight Promise and when() implementation, plus other async goodies.

Historical note: Prior to v26.x, AutobahnJS used the excellent ws library for WebSocket support in Node.js. With Node.js 22+ providing native WebSocket, this dependency is no longer needed.

Issues· 91 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptautobahnhtml5javascriptnodejs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架