{"id":20303603,"url":"https://github.com/elahe-dastan/haproxy","last_synced_at":"2025-03-04T07:12:20.691Z","repository":{"id":113152705,"uuid":"286038696","full_name":"elahe-dastan/haproxy","owner":"elahe-dastan","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-12T18:06:28.000Z","size":169,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:14:32.741Z","etag":null,"topics":["docker-compose","go","golang","haproxy","http","load-balancer"],"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/elahe-dastan.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":"2020-08-08T12:25:56.000Z","updated_at":"2021-03-30T20:04:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"cab9ee59-c124-4b64-81bf-6a6e623c9988","html_url":"https://github.com/elahe-dastan/haproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elahe-dastan%2Fhaproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elahe-dastan%2Fhaproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elahe-dastan%2Fhaproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elahe-dastan%2Fhaproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elahe-dastan","download_url":"https://codeload.github.com/elahe-dastan/haproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801257,"owners_count":20022389,"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":["docker-compose","go","golang","haproxy","http","load-balancer"],"created_at":"2024-11-14T16:39:28.769Z","updated_at":"2025-03-04T07:12:20.671Z","avatar_url":"https://github.com/elahe-dastan.png","language":"Go","readme":"[![Build Status](https://cloud.drone.io/api/badges/elahe-dastan/haproxy/status.svg)](https://cloud.drone.io/elahe-dastan/haproxy)\n# haproxy\nI have had a repository for learning and practicing 'nats' then I started thinking about what the difference is\u003cbr/\u003e\nbetween different technologies for load balancing.The biggest difference is that technologies like 'nats' and\u003cbr/\u003e\n'rabbitmq' are used to dispatch jobs inside a project to different workers but technologies like 'nginx' and 'haproxy'\u003cbr/\u003e\nare used to dispatch incoming http requests to different servers.\nIn this repository I want to learn how to use 'haproxy' to balance http traffic.\n\n## How to use haproxy\nUsing haproxy is super simple regardless of the language of backend here I have an easy code in golang and then added \u003cbr/\u003e\nhaproxy.\u003cbr/\u003e\nMy code creates an endpoint and with every get request it just sleeps 5 seconds and then says hi.\u003cbr/\u003e\n![](image/echo.png)\n\n![](image/handler.png)\u003cbr/\u003e\u003cbr/\u003e\nthen we need haproxy itself, I use docker-compose to run it\u003cbr/\u003e\u003cbr/\u003e\n![](image/docker-compose.png)\n\nHaproxy needs a config file called haproxy.cfg that I show later, the point I want to mention in here is that since\u003cbr/\u003e\nI have used docker-compose to run haproxy I vae to mount the haproxy.cfg file as shown in the screenshot\n\nHere is my haproxy.cfg file\u003cbr/\u003e\u003cbr/\u003e\n![](image/haproxy.png)\n\nMerge Request by [Parham Alvani](https://github.com/1995parham)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felahe-dastan%2Fhaproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felahe-dastan%2Fhaproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felahe-dastan%2Fhaproxy/lists"}