Skip to content
🔌 Wrapper for both WAMPClient and WAMPServer
Branch: development
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
example 💅 Fix spelling errors Mar 2, 2018
.babelrc prepare production files Mar 27, 2017
Jenkinsfile linting as a separate jenkins stage Aug 7, 2017
MasterWAMPServer.js Remove unnecessary signatures from RPC logic; use SC respond callback… May 25, 2018
SlaveWAMPServer.js Add new test cases May 25, 2018
SlaveWAMPServer.spec.js Add new test cases May 25, 2018
WAMPClient.spec.js Fix unit tests May 25, 2018
WAMPServer.js Add socketId to the the RPC request May 25, 2018
index.js setup eslint and fix source files Aug 7, 2017
package.json Bump version May 28, 2018
schemas.js Remove unnecessary signatures from RPC logic; use SC respond callback… May 25, 2018
testSetup.spec.js include example in linting, use test setup Aug 7, 2017
utils.js Satisfy linter Feb 6, 2018
webpack.config.js setup eslint and fix source files Aug 7, 2017

WAMP Socket Cluster

Merges RPC ideas of WAMP protocol with good performance of SocketCluster.

As SocketCluster is not compatible with WAMP protocol (as e.g. AutobahnJS) this library provides the wrapper for both SocketClient (WAMPClient) and SocketServer (WAMPServer) and enables RPC web sockets usage.


  • WAMP protocol style function calls (
  • Addresses the problem of response order in case of subscribing to an event after peer sends many individual requests.


npm install wamp-socket-cluster


  • Initialize server side
const rpcEndpoints = { multiplyByTwo: num => num * 2 };
scServer.on('connection', socket => {
  • Initialize client side
const socket = scClient.connect(options);
const randNumber =  Math.floor( Math.random() * 5 );'multiplyByTwo', 2)
      .then(result => console.log(`RPC result: ${randNumber} * 2 = ${result}`))
      .catch(err => console.error('RPC multiply by two error'));

Example Usage

A simple but complete example has been implemented. It includes socket cluster initialization, plus registration of RPC both at client and server side.


  • npm test



Copyright (c) 2017 Lisk Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

You can’t perform that action at this time.