node package manager

legend

legend

A redis backed node.js load balancer. Uses round-robin to load balance servers. It listens for changes in your redis database and updates the server list.

Getting Started

var Legend = require('legend');
var redis  = require('redis');
var client = redis.createClient();
 
var legend = new Legend({
  client: client,
  subscribe: 'servers' // <---- Tells redis to subscribe here 
});
 
// Add the first server 
legend.addNode('192.168.1.1', '8080');
 
// Add the second server 
legend.addNode('192.168.1.2', '8080');
 
// Finally run the server 
legend.run(8080);