0.0.5 • Published 2 years ago
@darkflare/balancer v0.0.5
darkflare/balancer
Installation
# Get the latest release.
npm i @darkflare/balancer
Usage
Create a file named
originServers.json
in yoursrc
folder.{ "us": ["127.0.0.3"], // country specific servers "*": ["127.0.0.1", "127.0.0.2"] // any country }
Create a file named either
error.html
,error.json
orerror.txt
in yoursrc
folder to serve when no server is available to handle the request.Build your worker script.
npx @darkflare/balancer
Health Checks
The load balancer makes a HEAD
request to http://{server_ip}/health
. The server is considered healthy when the status code of the response is 2**
.