{"id":31955469,"url":"https://github.com/eggjs/egg-http-proxy","last_synced_at":"2025-10-14T14:17:30.319Z","repository":{"id":38395611,"uuid":"244511942","full_name":"eggjs/egg-http-proxy","owner":"eggjs","description":"http proxy for egg","archived":false,"fork":false,"pushed_at":"2023-12-11T12:28:41.000Z","size":42,"stargazers_count":42,"open_issues_count":5,"forks_count":7,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-09-17T12:46:39.469Z","etag":null,"topics":["egg","egg-plugin","http-proxy"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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}},"created_at":"2020-03-03T01:16:39.000Z","updated_at":"2025-04-10T03:19:50.000Z","dependencies_parsed_at":"2022-08-25T04:20:30.702Z","dependency_job_id":"36e2cad4-764c-4ade-873c-400f6cc87191","html_url":"https://github.com/eggjs/egg-http-proxy","commit_stats":{"total_commits":16,"total_committers":4,"mean_commits":4.0,"dds":0.1875,"last_synced_commit":"175a64b424bbf9eb6418931a7cc4321f67599a2c"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/eggjs/egg-http-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-http-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-http-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-http-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-http-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/egg-http-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-http-proxy/sbom","scorecard":{"id":368736,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggjs/egg-http-proxy","commit":"175a64b424bbf9eb6418931a7cc4321f67599a2c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"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":"Code-Review","score":4,"reason":"Found 7/16 approved changesets -- score normalized to 4","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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 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-18T12:29:19.004Z","repository_id":38395611,"created_at":"2025-08-18T12:29:19.004Z","updated_at":"2025-08-18T12:29:19.004Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019153,"owners_count":26086576,"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-14T02:00:06.444Z","response_time":60,"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":["egg","egg-plugin","http-proxy"],"created_at":"2025-10-14T14:17:29.765Z","updated_at":"2025-10-14T14:17:30.313Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","readme":"# @eggjs/http-proxy\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/http-proxy.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/http-proxy\n[travis-image]: https://img.shields.io/travis/eggjs/egg-http-proxy.svg?style=flat-square\n[travis-url]: https://travis-ci.org/eggjs/egg-http-proxy\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-http-proxy.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/egg-http-proxy?branch=master\n[david-image]: https://img.shields.io/david/eggjs/egg-http-proxy.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs/egg-http-proxy\n[snyk-image]: https://snyk.io/test/npm/@eggjs/http-proxy/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/http-proxy\n[download-image]: https://img.shields.io/npm/dm/@eggjs/http-proxy.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/http-proxy\n\nA simple http proxy base on egg httpclient.\n\n## Install\n\n\n```bash\n$ npm i @eggjs/http-proxy --save\n```\n\n```js\n// {app_root}/config/plugin.js\nexports.httpProxy = {\n  enable: true,\n  package: '@eggjs/http-proxy',\n};\n```\n\n## Usage\n\n```js\n/**\n * @param {String} host - target host.\n * @param {Object} [options] - options for request, see https://github.com/node-modules/urllib\n * @param {Boolean} [options.withCredentials] - if true, will send cookie when cors\n * @param {Function} [options.rewrite] - rewrite target url obj\n */\nawait ctx.proxyRequest(host, options);\n```\n\n### target host\n\n```js\n// current url: http://eggjs.org/api/user -\u003e http://github.com/api/user\nawait ctx.proxyRequest('github.com');\n```\n\n### rewrite path\n\n```js\n// current url: http://eggjs.org/api/user -\u003e http://github.com/egg/eggjs/api/user\nawait ctx.proxyRequest('github.com', {\n  rewrite(urlObj) {\n    urlObj.pathname = '/egg/eggjs/api/user';\n    return urlObj;\n  },\n});\n```\n\n### modify response\n\n```js\nawait ctx.proxyRequest('github.com', {\n\n  streaming: false,\n\n  async beforeResponse(proxyResult) {\n    proxyResult.headers.addition = 'true';\n    // streaming=false should modify `data`, otherwise use stream to handler proxyResult.res yourself\n    proxyResult.data = proxyResult.data.replace('github.com', 'www.github.com');\n    return proxyResult;\n  },\n});\n```\n\n## Configuration\n\n```js\n// {app_root}/config/config.default.js\nexports.httpProxy = {\n\n};\n```\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-http-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fegg-http-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-http-proxy/lists"}