socket.io adapter rabbitmq implementation.
$ npm install socket.io-rabbitmq
var io = require('socket.io')(3000);
var rabbitmq = require('socket.io-rabbitmq');
io.adapter(rabbitmq({
host: '127.0.0.1',
port: 5672
}));
The following options are allowed:
key
: the name of the key to pub/sub events on as prefix (socket.io-rabbitmq
)host
: host to connect to rabbitmq pub/sub server on (127.0.0.1
)port
: port to connect to rabbitmq pub/sub server on (5672
)pubClient
: optional, the rabbitmq client to publish events onsubClient
: optional, the rabbitmq client to subscribe to events on
If you decide to supply pubClient
and subClient
, make sure you use amqplib as a client or one with an equivalent API.
First, run the socket.io rabbitmq server
$ socket.io-rabbitmq-server
after that, run the test.
$ make test