Gathering detailed insights and metrics for koa-proxies-better
Gathering detailed insights and metrics for koa-proxies-better
Gathering detailed insights and metrics for koa-proxies-better
Gathering detailed insights and metrics for koa-proxies-better
npm install koa-proxies-better
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
355
Last Day
2
Last Week
3
Last Month
7
Last Year
107
161 Stars
91 Commits
45 Forks
3 Watching
3 Branches
14 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
koa-proxies-better@1.0.1
Unpacked Size
9.93 kB
Size
4.31 kB
File Count
8
NPM Version
8.19.1
Node Version
14.20.0
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
50%
3
Compared to previous week
Last month
-22.2%
7
Compared to previous month
Last year
2.9%
107
Compared to previous year
2
1
Koa@2.x/next middlware for http proxy
Powered by http-proxy
.
1$ npm install koa-proxies --save
1options.events = { 2 error (err, req, res) { }, 3 proxyReq (proxyReq, req, res) { }, 4 proxyRes (proxyRes, req, res) { } 5}
1// enable log
2options.logs = true; // or false
3
4// custom log function
5options.logs = (ctx, target) {
6 console.log('%s - %s %s proxy to -> %s', new Date().toISOString(), ctx.req.method, ctx.req.oldPath, new URL(ctx.req.url, target))
7}
1// dependencies 2const Koa = require('koa') 3const proxy = require('koa-proxies') 4const httpsProxyAgent = require('https-proxy-agent') 5 6const app = new Koa() 7 8// middleware 9app.use(proxy('/octocat', { 10 target: 'https://api.github.com/users', 11 changeOrigin: true, 12 agent: new httpsProxyAgent('http://1.2.3.4:88'), // if you need or just delete this line 13 rewrite: path => path.replace(/^\/octocat(\/|\/\w+)?$/, '/vagusx'), 14 logs: true 15}))
Please make sure that koa-proxies
is in front of koa-bodyparser
to avoid this issue 55
1const Koa = require('koa') 2const app = new Koa() 3const proxy = require('koa-proxies') 4const bodyParser = require('koa-bodyparser') 5 6app.use(proxy('/user', { 7 target: 'http://example.com', 8 changeOrigin: true 9})) 10 11app.use(bodyParser())
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 8/26 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
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