https://github.com/bugthesystem/socket.io-rabbitmq
socket.io adapter rabbitmq implementation
https://github.com/bugthesystem/socket.io-rabbitmq
Last synced: 7 months ago
JSON representation
socket.io adapter rabbitmq implementation
- Host: GitHub
- URL: https://github.com/bugthesystem/socket.io-rabbitmq
- Owner: bugthesystem
- License: mit
- Created: 2015-06-01T20:52:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-19T22:28:33.000Z (about 11 years ago)
- Last Synced: 2025-02-14T13:06:24.469Z (over 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# socket.io-rabbitmq
socket.io adapter [rabbitmq](https://www.rabbitmq.com/) implementation.
# Installing
```
$ npm install socket.io-rabbitmq
```
# Usage
```js
var io = require('socket.io')(3000);
var rabbitmq = require('socket.io-rabbitmq');
io.adapter(rabbitmq({
host: '127.0.0.1',
port: 5672
}));
```
# API
## adapter(opts)
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 on
- `subClient`: optional, the rabbitmq client to subscribe to events on
If you decide to supply `pubClient` and `subClient`, make sure you use [amqplib](https://github.com/squaremo/amqp.node/) as a client or one with an equivalent API.
# Testing
First, run the socket.io rabbitmq server
```shell
$ socket.io-rabbitmq-server
```
after that, run the test.
```shell
$ make test
```
# License
[MIT license](https://github.com/ziyasal/socket.io-rabbitmq/blob/master/LICENSE)