{"id":15357162,"url":"https://github.com/gera2ld/koa-proxypass","last_synced_at":"2025-07-05T05:04:10.967Z","repository":{"id":77381434,"uuid":"50965418","full_name":"gera2ld/koa-proxypass","owner":"gera2ld","description":"A proxy-pass server for koa","archived":false,"fork":false,"pushed_at":"2016-04-18T10:33:52.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T14:57:56.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/gera2ld.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":"2016-02-03T01:39:16.000Z","updated_at":"2016-11-17T04:48:44.000Z","dependencies_parsed_at":"2023-05-31T10:15:20.081Z","dependency_job_id":null,"html_url":"https://github.com/gera2ld/koa-proxypass","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"f6a3c47c72224eea43b2455fcd104c299b00fd9e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fkoa-proxypass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fkoa-proxypass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fkoa-proxypass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fkoa-proxypass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gera2ld","download_url":"https://codeload.github.com/gera2ld/koa-proxypass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241913788,"owners_count":20041459,"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","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-10-01T12:33:37.797Z","updated_at":"2025-03-04T19:46:20.664Z","avatar_url":"https://github.com/gera2ld.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"koa-proxypass\n===\n\n![NPM](https://img.shields.io/npm/v/koa-proxypass.svg)\n![License](https://img.shields.io/npm/l/koa-proxypass.svg)\n![Downloads](https://img.shields.io/npm/dt/koa-proxypass.svg)\n\nA proxy-pass server for koa.\n\nInstallation\n---\n``` sh\n$ npm install koa-proxypass\n```\n\nUsage\n---\n``` javascript\nconst koa = require('koa')\nconst proxy = require('koa-proxypass')\n\nconst app = koa()\n\napp.use(proxy({\n  upstreams: [{\n    match: {\n      host: 'localhost',\n    },\n    children: [{\n      match: {\n        path: /^\\/api\\//,\n      },\n      target: 'http://gerald.top',\n      path: '',\n    }],\n  }]\n}))\n```\n\nDocument\n---\nThere is one parameter `options` for `proxy`. `options` has attributes below:\n\n* `upstreams`\n\n  an array of upstream rules, each rule may have attributes below:\n\n  * `match`: Object | Function (param *request*)\n\n    The object will be tested for each key-value pairs, and return true if all matched. Each value can be an `RegExp` or `Function (param *responding-value*)` for smart test or `Any` for exact match.\n\n    The function will have the request object with `method`, `path`, `header` attributes as the only parameter.\n\n  * `children`: Array\n\n    An array of children `upstreams`\n\n  * `target`: String\n\n    The target server composed of scheme and host, including port.\n\n  * `path`: String | Function\n\n    If provided, the matched path will be replaced with it.\n\n  * `changeOrigin`: Boolean\n\n    Whether `host` should be updated to the target upstream, passed to [http-proxy](https://github.com/nodejitsu/node-http-proxy).\n\n  * `secure`: Boolean\n\n    Whether SSL certificate should be verified for upstream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fkoa-proxypass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgera2ld%2Fkoa-proxypass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fkoa-proxypass/lists"}