# wsc-redis **Repository Path**: wscluster/wsc-redis ## Basic Information - **Project Name**: wsc-redis - **Description**: 一个基于 Redis 的 ws-cluster 中转适配器。 - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: master - **Homepage**: http://git.oschina.net/wscluster/ws-cluster - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-07-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # wsc-redis A redis broker for [ws-cluster](https://github.com/wscluster/ws-cluster). It allows you to scale `ws-cluster` horizontally across multiple machines. ## Installation ```bash $ npm install wsc-redis --save ``` ## Usage ```js var wsc = require('ws-cluster'); var Broker = require('wsc-redis'); var server = wsc.createServer({ broker: new Broker(6379, 'localhost') }); ``` ## API ### new Broker() Return a redis broker instance. `new Broker()` accepts these arguments: - `redis.createClient([options])` - `redis.createClient(unix_socket[, options])` - `redis.createClient(redis_url[, options])` - `redis.createClient(port[, host][, options])` The arguments will be passed to [`redis.createClient()`](https://www.npmjs.com/package/redis#rediscreateclient).