2.0.0 • Public • Published

A Socket.IO Adapter for use with RabbitMQ and other AMQP services.

Build Status

NPM version

How to use

var io = require('')(3000);
var amqp_adapter = require('');


adapter(uri[, opts], [onNamespaceInitializedCallback])

uri is a string like amqp://localhost which points to your AMQP / RabbitMQ server. The amqp:// scheme is MANDATORY. If you need to use a username & password, they must be embedded in the URI.

The following options are allowed:

  • prefix: A prefix that will be applied to all queues, exchanges and messages created by

  • queueName: The name of the rabbitmq queue to use listen in on the exchange. Must be unique. Default value is '' which means rabbitmq will auto generate a queue name for you that is unique.

  • channelSeperator: The delimiter between the prefix, the namespace name, and the room, the default is '#' for compatibility with, but if you don't use it,you should change it because # is a wildcard character in rabbitmq which means you may get cross chatter with other rooms.

  • onNamespaceInitializedCallback: This is a callback function that is called everytime opens a new namespace. Because a new namespace requires new queues and exchanges, you can get a callback to indicate the success or failure here. This callback should be in the form of function(err, nsp), where err is the error, and nsp is the namespace. If your code needs to wait until is fully set up and ready to go, you can use this.

  • useInputExchange option: This configures the use of 2 exchanges and where is a fanout exchange and is bound to it.




Package Sidebar


Weekly Downloads






Last publish


  • gkolesnikov
  • niksawtschuk
  • sgiacomel
  • gabrielcastro