Installations
npm install koa-proxy
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.16.0
NPM Version
6.10.1
Score
80.3
Supply Chain
89.9
Quality
69.9
Maintenance
50
Vulnerability
97
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
edorivai
Download Statistics
Total Downloads
3,804,485
Last Day
3,355
Last Week
16,682
Last Month
75,385
Last Year
598,301
GitHub Statistics
45 Stars
78 Commits
19 Forks
3 Watchers
2 Branches
1 Contributors
Updated on Dec 02, 2024
Bundle Size
696.76 kB
Minified
187.96 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0-alpha.3
Package Id
koa-proxy@1.0.0-alpha.3
Size
3.26 kB
NPM Version
6.10.1
Node Version
10.16.0
Published on
Jul 23, 2019
Total Downloads
Cumulative downloads
Total Downloads
3,804,485
Last Day
9.1%
3,355
Compared to previous day
Last Week
-2%
16,682
Compared to previous week
Last Month
40.6%
75,385
Compared to previous month
Last Year
34.4%
598,301
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Peer Dependencies
1
Dev Dependencies
8
koa-proxy 
Proxy middleware for koa
Install
$ npm install koa-proxy -S
Usage
When you request http://localhost:3000/index.js, it will fetch http://alicdn.com/index.js and return.
1var koa = require('koa'); 2var proxy = require('koa-proxy'); 3var app = koa(); 4app.use(proxy({ 5 host: 'http://alicdn.com' 6})); 7app.listen(3000);
You can proxy a specified url.
1app.get('index.js', proxy({ 2 url: 'http://alicdn.com/index.js' 3}));
You can specify a key/value object that can map your request's path to the other.
1app.get('index.js', proxy({ 2 host: 'http://alicdn.com', 3 map: { 4 'index.js': 'index-1.js' 5 } 6}));
You can specify a function that can map your request's path to the desired destination.
1app.get('index.js', proxy({ 2 host: 'http://alicdn.com', 3 map: function(path) { return 'public/' + path; } 4}));
You can specify match criteria to restrict proxy calls to a given path.
1app.use(proxy({ 2 host: 'http://alicdn.com', // proxy alicdn.com... 3 match: /^\/static\// // ...just the /static folder 4}));
Or you can use match to exclude a specific path.
1app.use(proxy({ 2 host: 'http://alicdn.com', // proxy alicdn.com... 3 match: /^(?!\/dontproxy\.html)/ // ...everything except /dontproxy.html 4}));
Proxy won't send cookie to real server, you can set jar = true
to send it.
1app.use(proxy({ 2 jar: true, 3}));
Proxy won't send 'foo' and 'bar' headers to real server, or recieve 'jar-jar' from real server.
1app.use(proxy({ 2 suppressRequestHeaders: ['foo','bar'], // case-insensitive 3 suppressResponseHeaders: ['jar-jar'] // case-insensitive 4}));
You can also add new headers to your response or override existing ones
1app.use(proxy({ 2 overrideResponseHeaders: { 3 "cow": "moo", 4 "duck": "quack" 5 }, 6}));
LICENSE
Copyright (c) 2014 popomore. Licensed under the MIT license.

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
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
Reason
18 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-h452-7996-h45h
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-29xr-v42j-r956
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
Score
1.4
/10
Last Scanned on 2025-02-24
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More