0.0.5 • Published 3 years ago
@darkflare/balancer v0.0.5
darkflare/balancer
Installation
# Get the latest release.
npm i @darkflare/balancerUsage
Create a file named
originServers.jsonin yoursrcfolder.{ "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.jsonorerror.txtin yoursrcfolder 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**.