{"id":22599502,"url":"https://github.com/stewartpark/http-shield","last_synced_at":"2026-04-13T12:01:59.416Z","repository":{"id":139970427,"uuid":"246399049","full_name":"stewartpark/http-shield","owner":"stewartpark","description":"☸️ http-shield is a Kubernetes sidecar container that protects your HTTP service from a burst of requests.","archived":false,"fork":false,"pushed_at":"2020-03-10T20:28:07.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T18:42:58.513Z","etag":null,"topics":["confd","haproxy","http","kubernetes","sidecar"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/stewartpark.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-03-10T20:15:57.000Z","updated_at":"2020-03-22T18:18:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c666efc-b0fd-48f4-a785-dce04e4b272b","html_url":"https://github.com/stewartpark/http-shield","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stewartpark/http-shield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stewartpark%2Fhttp-shield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stewartpark%2Fhttp-shield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stewartpark%2Fhttp-shield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stewartpark%2Fhttp-shield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stewartpark","download_url":"https://codeload.github.com/stewartpark/http-shield/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stewartpark%2Fhttp-shield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["confd","haproxy","http","kubernetes","sidecar"],"created_at":"2024-12-08T11:09:51.055Z","updated_at":"2026-04-13T12:01:59.397Z","avatar_url":"https://github.com/stewartpark.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-shield\n\n![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/stewartpark/http-shield?style=flat-square)\n![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/stewartpark/http-shield?style=flat-square)\n\n☸️ http-shield is a Kubernetes sidecar container that protects a concurrent, compute-heavy service from a burst of requests. (HAProxy, confd)\n\nThere's a `docker-compose.yml` file for demo purposes, if you'd like to try it out quickly.\n\n```\n# Demo app waits for 1 second before it returns a response.\n$ docker-compose up -d\n\n# 10 concurrent requests to an endpoint that only allows 1 concurrent connection\n$ ab -n 10 -c 10 http://localhost:8080/api/heavy1\n...\nRequests per second:    1.00 [#/sec] (mean)\n...\n\n# 10 concurrent requests to an unprotected endpoint\n$ ab -n 10 -c 10 http://localhost:8080/\n...\nRequests per second:    4.99 [#/sec] (mean)\n...\n```\n\n## How it works\n\nWhen the container starts, it reads environment variables and generate a configuration file for HAProxy via [confd](http://www.confd.io/). And then, [HAProxy](http://www.haproxy.org/) takes care of the reverse proxying part to your application.\n\nSince this sidecar uses battle-tested software as its parts, it can be trusted to do its job!\n\n## How to use\n\nYou can use this as a Kubernetes sidecar container to your service like this:\n\n```yaml\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  ...\nspec:\n  ...\n  template:\n    ...\n    spec:\n      containers:\n        - name: http-shield\n          image: stewartpark/http-shield:latest\n          ports: [{ containerPort: 8080 }]\n          env:\n            - name: SERVER_PORT\n              value: '3000'  # Your application's port\n            - name: ENDPOINTS_0\n              value: '1:/api/heavy1,/api/heavy2' # These APIs will only allow one concurrent connections (if /api/heavy1 has one, /api/heavy2 waits)\n            - name: ENDPOINTS_1\n              value: '10:/api/hi' # You can add more than one rule. /api/hi will have the maximum concurrency of 10.\n            # Rest of the endpoints will be unprotected and will have unlimited concurrency.\n        - name: your-app\n          ...\n```\n\nAnd let your Service resource point to `8080`, instead of your application port.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstewartpark%2Fhttp-shield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstewartpark%2Fhttp-shield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstewartpark%2Fhttp-shield/lists"}