README
socket.io-zeromq
socket.io adapter zeromq implementation.
Installing
$ npm install socket.io-zeromq
required the following:
- zeromq >= 4.0.4
- socket.io-zeromq-server
Usage
var io = require('socket.io')(3000);
var zmq = require('socket.io-zeromq');
io.adapter(zmq({
host: '127.0.0.1',
pubPort: 5555,
subPort: 5556
}));
API
adapter(opts)
The following options are allowed:
key
: the name of the key to pub/sub events on as prefix (socket.io-zmq
)host
: host to connect to zeromq pub/sub server on (127.0.0.1
)pubPort
: port to connect to publisher of zeromq pub/sub server on (5555
)subPort
: port to connect to subscriber of zeromq pub/sub server on (5556
)pubClient
: optional, the zeromq client to publish events onsubClient
: optional, the zeromq client to subscribe to events on
If you decide to supply pubClient
and subClient
, make sure you use node-zeromq as a client or one with an equivalent API.
Testing
First, run the socket.io zeromq server
$ socket.io-zeromq-server
after that, run the test.
$ make test
License
See the LICENSE
.