1.0.0 • Published 9 months ago

@alb-xh/load-balancer v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

@alb-xh/load-balancer

Development

  1. nvm use
  2. npm i
  3. npm run simulate

Usage

  1. npm i @alb-xh/load-balancer (node >= 20)
  2. Example
import { LoadBalancer } from '@alb-xh/load-balancer';

const lb = new LoadBalancer({
  serverUrls: [
    new URL('http://localhost:4000'),
    new URL('http://localhost:4001'),
    new URL('http://localhost:4002'),
  ],
  algo: 'round-robin',
});

lb.listen(5000, () => {
  console.log('Listening');
});
1.0.0

9 months ago