osmia-xbalancer

0.1.1 • Public • Published

xBalancer

Build Status

Load balancer for http(s) and websocket services

Current supported balance policy:

  • Round robin: requests are evenly distributed to each worker

TODO:

  • Least connected: requests are always distributed to the worker that has least connected clients
  • Weighted: requests are distributed according the weight assgined
  • IP Hashing: The target worker is determined by the hash of IP address of the client that initiated the request

Usage

Make a round-robin load balancer:

var balancer = require("xbalancer")({
  port: 8888,
  targets: ["http://localhost:8001", "http://localhost:8002"]
});
balancer.start(function() {
  console.log("xBalancer is up and running at port 8888");
});

That's dead simple!

Remember:

  • proxying websocket is enabled by default
  • this is basically a reverse proxy

TODO

  • Benchmarks
  • Really hopes to find a way to do Direct Route or IP Tunneling.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0

Package Sidebar

Install

npm i osmia-xbalancer

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

12.4 kB

Total Files

11

Last publish

Collaborators

  • parweb