GithubHelp home page GithubHelp logo

armaanleg3nd / voidension Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

A simple load balancer written in go

Home Page: https://pkg.go.dev/github.com/armaanleg3nd/voidension

License: MIT License

Go 100.00%
load-balancer reverse-proxy

voidension's Introduction


voidension

A fast, simple and easy to configure Load Balancer


About Voidension

This project is designed to provide a simple, fast and easy to configure load balancer. It checks if a server is alive by a simple tcp dial. It forwards the request to the any server among the server list that is available. Since it aims for simplicity, it only supports load balancing based on the server availabilty. It locks the server that is being used to prevent multiple requests to the same server. It also supports a request queue to handle the requests when none of the servers are available.

Instructions for Setup

0. Clone this repository

Run the following command in the command line to clone the repostiory

git clone https://github.com/ArmaanLeg3nd/voidension.git
1. Install the Dependencies

Run the following command in the command line to install all the dependencies

go mod tidy
2. Create a configuration file

To configure the application, create a YAML configuration file named config.yaml and define the following parameters under the app, incoming and outgoing sections:

app Parameters
app:
  port: integer                      # Specify the port number for the application (integer).
  dirPath: string                    # Specify the directory path for the application (string).
  receivePath: string                # Specify the path where the application will receive the POST requests (string).
  checkAvailabilityTimeout: integer  # Specify the timeout in milliseconds for checking if the servers are alive (integer).
incoming Parameters
incoming:
  allowedIPs: []string               # Specify the allowed host IPs in an array of strings. Can be left empty to allow all incoming request IPs.
outgoing Parameters
outgoing:
  serverPostURLs: []string           # Specify the server POST URLs in an array of strings

One such example config.yaml file is as follows:

app:
  port: 3030
  dirPath: "./voidension"
  receivePath: "/receive"
  checkAvailabilityTimeout: 10000
incoming:
  allowedIPs: []
outgoing:
  serverPostURLs: ["http://localhost:8080/receive"]
3. Run voidension

Run voidension by running the following command

go run main.go --config [path/to/YAML/configuration/file]

OR

Incase the config.yaml file is in the root directory, run the following command

go run main.go

voidension's People

Contributors

armaanleg3nd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.