New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

osmia-xbalancer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osmia-xbalancer

Smart loadbalancer for Websocket and http servers

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

loadbalancer

FAQs

Package last updated on 17 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts