{"id":29666628,"url":"https://github.com/cantro93/bot-check","last_synced_at":"2026-05-14T23:32:15.356Z","repository":{"id":305008316,"uuid":"1021540626","full_name":"Cantro93/bot-check","owner":"Cantro93","description":"Simple CAPTCHA-like mechanism to deny access to bots. Only Node.js version available","archived":false,"fork":false,"pushed_at":"2025-07-17T19:40:09.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T20:05:38.606Z","etag":null,"topics":["captcha","nodejs","security"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cantro93.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}},"created_at":"2025-07-17T14:52:02.000Z","updated_at":"2025-07-17T19:40:12.000Z","dependencies_parsed_at":"2025-07-17T22:50:44.527Z","dependency_job_id":null,"html_url":"https://github.com/Cantro93/bot-check","commit_stats":null,"previous_names":["cantro93/bot-check"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Cantro93/bot-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cantro93%2Fbot-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cantro93%2Fbot-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cantro93%2Fbot-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cantro93%2Fbot-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cantro93","download_url":"https://codeload.github.com/Cantro93/bot-check/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cantro93%2Fbot-check/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266521951,"owners_count":23942543,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["captcha","nodejs","security"],"created_at":"2025-07-22T15:39:10.589Z","updated_at":"2026-05-14T23:32:15.318Z","avatar_url":"https://github.com/Cantro93.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bot-check\n\n## About\n\nThis module will help verify if the traffic comes from bots or human client.\n\nIt's neither hogging on client's resources like Anubis nor gathering information like reCAPTCHA, and is free software distributed under LGPL 2.1.\n\n## Features\n\n- simple radio button form easy for human clients to fill;\n- storing only IP and form results;\n- no JS on client-side;\n- fields and values are randomized;\n- asks for verification only every specified interval;\n- no need of redirection in purpose of verification;\n- should be working with HTTPS;\n- customizable with CSS;\n- hosted directly on your server, as Node.js module.\n\n## To do\n\n- [ ] make function that will be used as event listener for server `request` event;\n- [ ] make npm package;\n- [ ] add whitelist and blacklist;\n- [ ] ensure support for `multipart/form-data`;\n- [ ] strengthen means of protection;\n- [ ] limit storage time of data.\n\n## Installation\n\nPut file botcheck.js into any place in your project, and use relative path in your `require` clause.\n\n## Usage (HTTP sample)\n\n```js\nconst http = require('http');\nconst BotCheck = require('./botcheck');\n\n// create new bot checker instance, with interval of 5 hours (18000 s) and no CSS\nglobal.bc = new BotCheck(18000, '');\n\nconst server = http.createServer((req,res) =\u003e {\n  // BotCheck will need access to body of POST request\n  let data = '';\n  req.on('data', chunk =\u003e {data += chunk.toString();});\n  req.on('end', () =\u003e {\n\n    // this object contains information how to treat that request\n    const auth_result = global.bc.auth(req, data, false);\n\n    // auth_result.state values and their meaning were describe in\n    switch (auth_result.state) {\n      case 'accept':\n        // as this request comes from human, serve content as normally\n      case 'reject':\n        // your response to bots should go here\n        break;\n      case 'do_auth':\n        res.writeHead(200, {'Content-Type': 'text/html', 'Location': 'verify.html'});\n        // auth_result.body contains HTML form to be filled by client\n        res.end(auth_result.body);\n        break;\n      default:\n        break;\n    }\n  });\n});\n\nserver.listen(1080, 'localhost', () =\u003e {console.log(\"server started\")});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantro93%2Fbot-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcantro93%2Fbot-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantro93%2Fbot-check/lists"}