{"id":18508097,"url":"https://github.com/imqueue/http-protect","last_synced_at":"2026-01-28T09:37:54.918Z","repository":{"id":210574291,"uuid":"726902438","full_name":"imqueue/http-protect","owner":"imqueue","description":"HTTP DDoS Protection Middleware","archived":false,"fork":false,"pushed_at":"2025-09-04T14:16:07.000Z","size":466,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-04T16:19:34.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imqueue.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-03T18:27:54.000Z","updated_at":"2025-09-04T14:16:10.000Z","dependencies_parsed_at":"2025-04-22T13:20:17.762Z","dependency_job_id":"005f4888-e420-43f3-8850-f900e6b03a11","html_url":"https://github.com/imqueue/http-protect","commit_stats":null,"previous_names":["imqueue/http-protect"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/imqueue/http-protect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imqueue%2Fhttp-protect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imqueue%2Fhttp-protect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imqueue%2Fhttp-protect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imqueue%2Fhttp-protect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imqueue","download_url":"https://codeload.github.com/imqueue/http-protect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imqueue%2Fhttp-protect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28843965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-06T15:13:22.752Z","updated_at":"2026-01-28T09:37:54.908Z","avatar_url":"https://github.com/imqueue.png","language":"TypeScript","readme":"# @imqueue/http-protect\n\nImplements simple HTTP traffic protection middleware for node-based express-like \nweb-servers to detect and block abnormal activity on a server from a detected\nIP sources.\n\nSimple configuration allows to set desired limit on number of requests per given\ntime period and define the blacklist threshold for the users which are by \nexceeding the limit continue to send requests to the server.\n\nThe service protected by this module may be configured on a code level or by\nsetting environment variables.\n\n## Requirements\n\n- redis server\n\n## Installation\n\n```bash\nnpm i @imqueue/http-protect\n```\n\n## Usage\n\n```typescript\nimport HttpProtect from '@imqueue/http-protect';\n\napp.use(new HttpProtect().jsonMiddleware());\n```\n\nOr it is possible to do manual injection:\n\n```typescript\nimport HttpProtect, { VerificationStatus } from '@imqueue/http-protect';\nimport { getClientIp } from 'request-ip';\n\n// inside some async function in the code\nconst protect = new HttpProtect();\nconst { status, httpCode } = await protect.verify(getClientIp(req));\n\nswitch (status) {\n    case VerificationStatus.LIMITED: {\n        // user us reached request limit, but not blacklisted yet.\n        // warn about abnormal usage\n        break;\n    }\n    case VerificationStatus.BANNED: {\n        // bad traffic source, requests must be banned\n        break;\n    }\n    default: {\n        // good request, safe to go\n        break;\n    }\n}\n```\n\nThis module aldo provides simple API to check if given IP is blacklisted or not,\nor get the list of banned network addresses:\n\n```typescript\nimport HttpProtect from '@imqueue/http-protect';\n\nconst protect = new HttpProtect();\n\n// get the list of banned networks\nconsole.log(protect.bannedNetworks().toJSON());\n\n// check if given IP is currently banned or not\nconsole.log(protect.isBanned('127.0.0.1'));\n\n// check if given IP is currently limited or not\nconsole.log(protect.isLimited('127.0.0.1'));\n```\n\nThis module uses redis server to deal with requests counters and banned \nnetworks. It also based on ioredis module to connect to redis server, so\nyou might want to configure it via constructor options or bypass existing\nioredis instance in the options. Please, refer `HttpProtectOptions` interface\nfor more details.\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0.\nSee the [LICENSE](LICENSE)\n\nHappy Coding!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimqueue%2Fhttp-protect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimqueue%2Fhttp-protect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimqueue%2Fhttp-protect/lists"}