{"id":15686164,"url":"https://github.com/cirocosta/l7","last_synced_at":"2025-05-07T18:22:14.266Z","repository":{"id":73883850,"uuid":"99730995","full_name":"cirocosta/l7","owner":"cirocosta","description":"Minimal HTTP 1.1 Proxy \u0026 Load-balancer","archived":false,"fork":false,"pushed_at":"2017-09-23T20:13:22.000Z","size":2864,"stargazers_count":9,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:57:26.030Z","etag":null,"topics":["go","golang","http","load-balancer","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cirocosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-08-08T19:56:54.000Z","updated_at":"2024-11-28T16:33:29.000Z","dependencies_parsed_at":"2023-09-21T11:06:56.558Z","dependency_job_id":null,"html_url":"https://github.com/cirocosta/l7","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fl7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fl7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fl7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fl7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirocosta","download_url":"https://codeload.github.com/cirocosta/l7/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931836,"owners_count":21827176,"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","http","load-balancer","web"],"created_at":"2024-10-03T17:35:33.957Z","updated_at":"2025-05-07T18:22:14.227Z","avatar_url":"https://github.com/cirocosta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003el7 📂  \u003c/h1\u003e\n\n\u003ch5 align=\"center\"\u003eMinimal HTTP 1.1 load-balancer\u003c/h5\u003e\n\n\u003cbr/\u003e\n\n[![Build Status](https://travis-ci.org/cirocosta/l7.svg?branch=master)](https://travis-ci.org/cirocosta/l7)\n\n\n### Overview\n\n\n`l7` is a load-balancer responsible for performing load-balancing based on parameters passed to it or a configuration file.\n\nIt allows you to, in a single line, specify a set of servers and have load sent uniformily to them.\n\n\n##### Command Line\n\nIn order to facilitate testing it's possible to specify all the arguments from the configuration file via parameters to the `l7` command.\n\n\n```sh\nUsage: l7 [--port PORT] [--config CONFIG] [--user USER] [SERVERS [SERVERS ...]]\n\nPositional arguments:\n  SERVERS\n\nOptions:\n  --port PORT, -p PORT   port to listen to [default: 80]\n  --config CONFIG, -c CONFIG\n                         configuration file to use\n  --user USER\n  --help, -h             display this help and exit\n\n\nExample:\n  sudo l7 \\\n        --user admin:admin \\\t\t# enforces basic auth on all requests\n        --user someone:mypasswd \\\t\t\n        --port 80 \\\t\t\t# binds to port 80\n         mydomain.com=127.0.0.1:8081 \\\t# list of server configurations\n         mydomain.com=127.0.0.1:8082 \\\n         mydomain.com=127.0.0.1:8083 \\\n         example.io=127.0.0.1:1337\n```\n\nIn the example above we make `l7` listen on port `80` and place two rules for load-balancing:\n- requests to `mydomain.com` should be split across 3 servers listening on 127.0.0.1\n- requests to `example.io` should go to `127.0.0.1:1337`\n- every request to either `mydomain.com` or `example.io` must be authenticated\n\n\n##### Configuration file\n\nThe configuration file can be located anywhere on disk. To use one, specify '-c|--config' configuration parameter to the `l7` command:\n\n\n```sh\nl7 --config ./config.yml   # use configuration from ./config.yml\n```\n\nThe configuration is composed of few definitions. Changing the following example should be enough to get going.\n\n```yaml\n# config.yml\nport: 80\t\nusers:\t\t\t# optional\n  myuser: 'passwd'\n  admin: 'admin'\nbackends:\n  example.com:\n    servers:\n      - address: 'http://192.168.0.103:8081'\n      - address: '//192.168.0.103:8082'         # no 'http(s)://' needed\n      - address: 'http://nginx'                 # hostnames can be used\n                                                # note.: dns resolution\n                                                #        will take place.\n```\n\nAbove we're specifying that:\n- we want `l7` listening on port 80 (this will require using `sudo` - a privileged user - to continue)\n- those requests with `host` set to `example.com` should be load-balanced across 3 distinct servers\n- all requests must be authenticated with either `myuser:passwd` or `admin:admin`. Note.: this configuration is not required.\n\n\nOnce initialized, the configuration can be reloaded without the need of restarting the whole process. Send a `SIGHUP` to the pid of the load-balancer to reload it on the fly. \n\nNote.: in the case of errors, `l7` won't crash, but retain the last valid configuration.\n\nTo visualize the latest configuration, send a `SIGUSR1` to the process. This will dump to `stdout` the configuration loaded by the `flb`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fl7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirocosta%2Fl7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fl7/lists"}