socket.io-zeromq

0.0.1 • Public • Published

socket.io-zeromq

NPM version Build Status Coverage Status Dependency Status

socket.io adapter zeromq implementation.

Installing

$ npm install socket.io-zeromq

required the following:

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 on
  • subClient: 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

MIT license.

See the LICENSE.

Package Sidebar

Install

npm i socket.io-zeromq

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • kazupon