1.0.0 • Published 9 years ago
ip-hash v1.0.0
ip-hash
Implementation of ip-hash balancing algorithm, based on round-robin.
Installation
$ npm install ip-hash --save
Usage
const iphash = require('ip-hash');
let servers = [
'server-1',
'server-2',
'server-3'
];
let assign = iphash(servers);
assign('192.168.0.1'); // => 'server-1'
assign('192.168.0.2'); // => 'server-2'
assign('192.168.0.3'); // => 'server-3'
assign('192.168.0.1'); // => 'server-1'
Tests
$ make test
License
ip-hash is released under the MIT license.
1.0.0
9 years ago