Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aksh-bansal-dev/load-balancer
A simple layer 4 load balancer with consistent-hashing support.
https://github.com/aksh-bansal-dev/load-balancer
Last synced: 25 days ago
JSON representation
A simple layer 4 load balancer with consistent-hashing support.
- Host: GitHub
- URL: https://github.com/aksh-bansal-dev/load-balancer
- Owner: Aksh-Bansal-dev
- License: mit
- Created: 2021-08-01T19:28:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-02T09:21:46.000Z (over 3 years ago)
- Last Synced: 2024-11-20T11:05:21.727Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Load Balancer
A simple layer 4 load balancer with sticky-sessions support.It uses hashing for sticky sessions.
## Config file
```
// config.json{
"lbport": "8080", // load balancer port
"type": "sticky", // "sticky" for sticky sessions or "random" (default).
"ports": [
{
"ip": "127.0.0.1",
"port": "5000"
},
{
"ip": "127.0.0.1",
"port": "8000"
},
{
"ip": "127.0.0.1",
"port": "3000"
}
]
}```
## How to use
- Create a config.json file from above template.
- `npm run start ` to start load balancer.
> Note: you can use demo.js to test the load balancer. Just run `npm run demo ` to start a server on that port.