https://github.com/kazupon/socket.io-zeromq
socket.io adapter zeromq implementation
https://github.com/kazupon/socket.io-zeromq
Last synced: 6 months ago
JSON representation
socket.io adapter zeromq implementation
- Host: GitHub
- URL: https://github.com/kazupon/socket.io-zeromq
- Owner: kazupon
- License: mit
- Created: 2014-06-22T14:43:13.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-02T17:01:45.000Z (over 11 years ago)
- Last Synced: 2025-06-13T05:49:15.443Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 180 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# socket.io-zeromq
[](http://badge.fury.io/js/socket.io-zeromq)
[](https://travis-ci.org/kazupon/socket.io-zeromq)
[](https://coveralls.io/r/kazupon/socket.io-zeromq)
[](https://david-dm.org/kazupon/socket.io-zeromq)
socket.io adapter [zeromq](http://zeromq.org/) implementation.
# Installing
```
$ npm install socket.io-zeromq
```
required the following:
- zeromq >= 4.0.4
- [socket.io-zeromq-server](https://github.com/kazupon/socket.io-zeromq-server)
# Usage
```js
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](https://github.com/JustinTulloss/zeromq.node) as a client or one with an equivalent API.
# Testing
First, run the socket.io zeromq server
```shell
$ socket.io-zeromq-server
```
after that, run the test.
```shell
$ make test
```
# License
[MIT license](http://www.opensource.org/licenses/mit-license.php).
See the `LICENSE`.