{"id":15089291,"url":"https://github.com/aavision/traffic-balancer","last_synced_at":"2025-04-11T22:02:30.022Z","repository":{"id":249512602,"uuid":"831558292","full_name":"AAVision/traffic-balancer","owner":"AAVision","description":"A Simple reverse proxy that provides load balancer services! 🚧 🚦🛰","archived":false,"fork":false,"pushed_at":"2024-09-08T10:38:37.000Z","size":1243,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T10:23:45.397Z","etag":null,"topics":["go","golang","load-balancer","traffic","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AAVision.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T23:19:06.000Z","updated_at":"2024-09-08T10:38:40.000Z","dependencies_parsed_at":"2024-09-07T12:52:35.873Z","dependency_job_id":"844b574a-8a6f-4846-bbb2-49af44177f53","html_url":"https://github.com/AAVision/traffic-balancer","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"991efbedef2c4b3a1b2f589eaf3f547f8ea68b8a"},"previous_names":["aavision/traffic-balancer"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAVision%2Ftraffic-balancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAVision%2Ftraffic-balancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAVision%2Ftraffic-balancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAVision%2Ftraffic-balancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AAVision","download_url":"https://codeload.github.com/AAVision/traffic-balancer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239785295,"owners_count":19696750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","load-balancer","traffic","yaml"],"created_at":"2024-09-25T08:44:18.956Z","updated_at":"2025-02-20T05:32:04.404Z","avatar_url":"https://github.com/AAVision.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traffic Balancer\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.postimg.cc/prDRd08h/logo.gif\" style=\"border-radius:10px;\"/\u003e\n\u003c/p\u003e\n\n**Load Balancing Algorithm**\n- least-time\n- weighted-round-robin\n- connection-per-time\n- round-robin\n\n## Description :books:\n\n- least-time: The load balancer will analyse and monitor the lower average latency of the provided servers and redirect the request to that server.\n- weighted-round-robin: On booting the load balance, it will read from the configuration file the weight of every server and redirect the request to the server with the highest weight rate.\n- connection-per-second: On booting the load balancer, it will check the number of connections on every server, and it will make that server inactive if the number of requests redirected per 1 minute exceeded the provided configuration of that server.\n- round-robin: It will redirect the request per index.\n\n**The load balancer checks the server's health status every 1 minute.**\n\n## Configuration :construction:\n\nUpdating the `config/config.yaml` file:\n```bash\n\n# least-time\n# weighted-round-robin\n# connection-per-time\n# round-robin\nalgorithm: \"weighted-round-robin\" # Algorithm to be used\nport: 3030 # Port that the reverse proxy will run on\nstrict: true # Strict mode for black-listing IPs\nlog: true # Save logs to file in log folder\naccess-control-allow-origin: \"*\" # CORS HEADERS\nmax-body-size: 1024 # Maximum body size!\nxss-protection: true # In default true it will add xss protection header to the requested sent from load balancer to the server.\nservers: #List of servers.\n  - \n    host: \"http://localhost:9876\"\n    weight: 0.1\n    connections: 1\n  \n  - \n    host: \"http://localhost\"\n    weight: 0.9\n    connections: 100\n\n```\n\n## Usage :rocket:\n\n```bash\ngo build\n```\n\n```bash\n./traffic-balancer \nLoad Balancer started at :3030\n```\n\n:warning: **don't forget to add your servers in the `config/config.yaml` file**\n\n## TO-DO :man_playing_handball:\t\n- ~~Adding more `Access-Control-Allow` header.~~\n- Add more load balancer algorithms.\n- Write unit tests.\n- ~~Add XSS Header protection.~~\n- ~~Add Body size.~~\n- Add MTLS.\n- Add Max File Size!\n- ~~Strict mode for blocking black listing IPs.~~\n- Gzip Compression.\n\n## LICENSE :balance_scale:\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/AAVision/traffic-balancer/blob/main/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faavision%2Ftraffic-balancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faavision%2Ftraffic-balancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faavision%2Ftraffic-balancer/lists"}