{"id":13464990,"url":"https://github.com/hiproxy/hiproxy","last_synced_at":"2025-10-05T22:44:02.949Z","repository":{"id":47084963,"uuid":"81442133","full_name":"hiproxy/hiproxy","owner":"hiproxy","description":"🛠 hiproxy is a lightweight proxy tool for Front-End developers based on Node.js that supports an NGINX-like configuration. 🔥","archived":false,"fork":false,"pushed_at":"2021-09-14T09:03:49.000Z","size":4088,"stargazers_count":685,"open_issues_count":11,"forks_count":51,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-09-11T09:46:05.575Z","etag":null,"topics":["certificate","hosts","http","https","nginx","nodejs","proxy","reverse-proxy","rewrite"],"latest_commit_sha":null,"homepage":"http://hiproxy.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiproxy.png","metadata":{"files":{"readme":"README-zh.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-09T11:12:09.000Z","updated_at":"2025-09-02T09:40:15.000Z","dependencies_parsed_at":"2022-09-12T07:50:32.145Z","dependency_job_id":null,"html_url":"https://github.com/hiproxy/hiproxy","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/hiproxy/hiproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiproxy%2Fhiproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiproxy%2Fhiproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiproxy%2Fhiproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiproxy%2Fhiproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiproxy","download_url":"https://codeload.github.com/hiproxy/hiproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiproxy%2Fhiproxy/sbom","scorecard":{"id":465116,"data":{"date":"2025-08-11","repo":{"name":"github.com/hiproxy/hiproxy","commit":"f1fbdac00565406afd0b07ed75ba40f0975ff721"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 3/21 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T12:16:55.331Z","repository_id":47084963,"created_at":"2025-08-19T12:16:55.331Z","updated_at":"2025-08-19T12:16:55.331Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278532357,"owners_count":26002345,"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-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["certificate","hosts","http","https","nginx","nodejs","proxy","reverse-proxy","rewrite"],"created_at":"2024-07-31T14:00:54.298Z","updated_at":"2025-10-05T22:44:02.909Z","avatar_url":"https://github.com/hiproxy.png","language":"JavaScript","readme":"# hiproxy\n\n\u003cimg src=\"https://avatars0.githubusercontent.com/u/29273417?v=3\" alt=\"hiproxy\" width=\"120\" height=\"120\"\u003e\n\nhiproxy是一个基于Node.js开发的轻量级网络代理工具，主要目的是为了解决多个开发者在开发过程中遇到的hosts管理和反向代理的问题。使得在开发时，不再需要修改系统hosts和启动一个Nginx服务。hiproxy扩展了hosts的语法，支持端口号。此外，hiproxy还支持通过类似于nginx配置文件的语法来配置代理。\n\n[![Build Status](https://travis-ci.org/hiproxy/hiproxy.svg?branch=master)](https://travis-ci.org/hiproxy/hiproxy)\n[![Build status](https://ci.appveyor.com/api/projects/status/0g898oor4o82ah8n/branch/master?svg=true)](https://ci.appveyor.com/project/zdying/hiproxy/branch/master)\n[![codecov](https://codecov.io/gh/hiproxy/hiproxy/branch/master/graph/badge.svg)](https://codecov.io/gh/hiproxy/hiproxy)\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat)](https://github.com/Flet/semistandard)\n[![npm](https://img.shields.io/npm/v/hiproxy.svg)](https://www.npmjs.com/package/hiproxy)\n[![Node.js version](https://img.shields.io/badge/node-%3E%3D0.12.7-green.svg)](https://nodejs.org/)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/hiproxy/hiproxy/blob/master/LICENSE)\n\n## Why Hiproxy\n\n在前端开发中，如果我们通常会遇到下面的一些问题：\n\n1. 调试线上页面问题，要在本地进行开发，需要能运行后端的项目（Node.js或者Java等项目），__前端工程师在本地搭建一套后端环境，可能代价比较大__。\n2. 如果有多个前端工程，__采用一个域名__，__部分工程__ 需要请求 __线上__ 资源，__部分__ 工程请求 __本地__。\n3. 为解决跨域等问题，本地开发时需要 __修改Response Header__。\n4. 本地开发https站点时，__证书不受信任__。\n5. 系统 __hosts修改__ 后，__不会立即生效__。\n\n我们会使用Nginx来解决上面的问题。Nginx很优秀，也是我们前端开发工程师的一个非常好的朋友。Nginx的配置文件风格，非常直观，编写配置效率很高。\n\n但是，使用Nginx的时候，我们同时需要使用hosts，把相关请求发送到本地的Nginx服务。\n\n此外，大部分情况下，Nginx的配置文件并不会被提交到代码仓库，所以团队中其他开发者之间会互相拷贝配置文件，这样效率比较低，而且一个人修改了配置文件，其他人的配置不会随之更新。对于多个域名的配置，也都是放到一个统一的目录，然后在主配置里面include，这样也不太方便。\n\n__hosts__、__反向代理__、__https__ 和 __缓存__ 这些琐碎的事情，能不能统一解决？\n\n于是有了hiproxy。\n\n## Features\n\n* 支持Nginx风格的配置文件格式，配置简单直观\n* 支持hosts以及扩展（支持端口号）\n* 支持插件扩展rewrite指令、CLI命令和页面\n* 支持HTTPS证书自动生成\n* 支持代理自动配置（Proxy auto-config）\n* 支持后台启动，日志输出到文件\n* 支持配置文件自动查找\n* 支持打开浏览器窗口并自动配置代理\n* 提供Node.js API\n* ...\n\n## Install\n\n```bash\nnpm install -g hiproxy\n```\n\n## Usage\n\n### CLI\n\n1. 启动服务\n```bash\nhiproxy start -p 5525 --debug --workspace \u003cpath-to-your-workspace\u003e\n```\n\n2. 配置浏览器代理\n\n```bash\n127.0.0.1:5525\n```\n\n__注意__: 也可在启动的时候，添加选项`--open [browser]`，这样hiproxy会自动打开一个浏览器窗口，并设置好代理。\n\n### Node.js API\n\n```js\nvar Server = require('hiproxy').Server;\nvar proxy = new Server(8848, 10086);\n\n// events\nproxy.on('request', function(req, res){\n  req.someThing = 'some thing';\n  console.log('new request =\u003e', req.method, req.url);\n});\n\nproxy.on('data', function(data){\n  console.log('on response =\u003e', data.toString());\n});\n\nproxy.start().then(function (servers) {\n  console.log('proxy server started at: 127.0.0.1:8848');\n});\n\n// stop proxy server\n// proxy.stop();\n\n// restart proxy server\n// proxy.restart();\n```\n\n## CLI命令和选项\n\n```bash\n\u003e hiproxy --help\n\nCommands:\n\n  start   Start a local proxy server\n  stop    Stop the local proxy server\n  restart  Restart the local proxy server\n  state   Show all the servers state\n  open    Open browser and set proxy\n\nOptions:\n\n  -v, --version     显示版本信息\n  -h, --help        显示帮助信息\n  -D, --daemon      后台运行\n  --log-dir         后台运行时日志存放路径（绝对路径），默认为用户目录\n  --log-time        显示日志时间\n  --log-level       过滤日志级别，只有指定级别的日志才会显示\n  --grep \u003ccontent\u003e  过滤日志内容，只有保护过滤字符串的日志才会显示\n```\n\n## 文档\n\n* \u003chttp://hiproxy.org/\u003e\n\n\u003e **提示**: 文档正在编写中，如果你愿意帮忙编写或者翻译文档，请联系[zdying@live.com](mailto:zdying@live.com)\n\n### 翻译步骤\n\n* 文档地址 : \u003chttps://github.com/hiproxy/documentation\u003e\n\n* 从这些[issues](https://github.com/hiproxy/hiproxy/issues?utf8=%E2%9C%93\u0026q=is%3Aissue%20is%3Aopen%20%5BTranslate%5D)中选择一个你准备翻译的Issue，告诉其他人你准备翻译这部分.\n\n* [fork](https://github.com/hiproxy/documentation/fork)项目.\n\n* 你可以直接替换掉对应目录中的内容成英文版本.\n\n* 提交 PR.\n\n \n## Wiki\n\n* \u003chttps://github.com/hiproxy/hiproxy/wiki\u003e\n\n## hosts配置示例\n\nhiproxy支持扩展的`hosts`，支持端口号，例如：\n\n```bash\n# comment\n127.0.0.1 example.com\n127.0.0.1:8800 blog.example.com life.example.com\n```\n\n## rewrite配置示例\n\n```bash\nset $port 8899;\nset $ip   127.0.0.1;\nset $online 210.0.0.0;\n\ndomain example.com {\n  location / {\n    proxy_pass http://$online/;\n  }\n\n  location /blog/ {\n    proxy_pass http://$ip:$port/blog/;\n\n    proxy_set_header from 'hiproxy';\n\n    set_header proxy 'hiproxy';\n  }\n}\n```\n\n## 示例\n\nHere is an Example project [https://github.com/hiproxy/hiproxy-example](https://github.com/hiproxy/hiproxy-example)\n\n## 运行测试\n\n```bash\nnpm test\n```\n\n## 贡献代码\n\n请参阅[CONTRIBUTING.md](https://github.com/hiproxy/hiproxy/blob/master/CONTRIBUTING.md)了解我们的行为准则以及如何为`hiproxy`贡献代码。\n\n## 作者\n\n* __zdying__ - _HTML/JavaScript/CSS/Node.js 开发者_ [zdying](https://github.com/zdying)\n* __zhouhailong__ - _HTML/JavaScript/CSS/Node.js 开发者_ [zhouhailong](https://github.com/zhouhailong)\n* __Alfred Sang (aka i5ting)__ - _Aircos CTO, StuQ 明星讲师, 开源项目Moa.js的作者, 同时也是Node.js的布道者_\n\n您也可以点击[contributors](https://github.com/hiproxy/hiproxy/graphs/contributors)查看其他贡献者。\n\n## 感谢\n\n* [v0lkan](https://github.com/v0lkan)\n* [JayLee404](https://github.com/JayLee404)\n* [Jeoxs](https://github.com/Jeoxs)\n* [James Fancy](https://segmentfault.com/u/jamesfancy)\n\n感谢上面的各位朋友帮忙翻译hiproxy的文档。\n\n## 升级日志\n\n详情请查看[CHANGELOG.md](./CHANGELOG.md)。\n\n## 依赖的第三方库\n\n* [hemsl](https://www.npmjs.com/package/hemsl) - a lightweight Node.js command line argv parser and command executor.\n* [colors](https://www.npmjs.com/package/colors) - get color and style in your node.js console.\n* [node-forge](https://www.npmjs.com/package/node-forge) - JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.\n* [op-browser](https://www.npmjs.com/package/op-browser) - Open browser window and set proxy.\n* [os-homedir](https://www.npmjs.com/package/os-homedir) - Node.js 4 `os.homedir()` ponyfill.\n* [url-pattern](https://www.npmjs.com/package/url-pattern) - easier than regex string matching patterns for urls and other strings. turn strings into data or data into strings.\n* [simple-mime](https://www.npmjs.com/package/simple-mime) - A simple mime database.\n\n感谢以上开源库的作者，提供了这些优秀的库。\n\n## License\n\n这个项目采用MIT协议，点击[LICENSE](https://github.com/hiproxy/hiproxy/blob/master/LICENSE)查看详细信息。\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiproxy%2Fhiproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiproxy%2Fhiproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiproxy%2Fhiproxy/lists"}