
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@nioh/proxy
Advanced tools
Install with npm
npm i @server/proxy --registry=http://npm.zkh360.com
代理控制器,proxy
import * as Koa from 'koa'
import * as Router from 'koa-router'
import * as body from 'koa-body'
import {proxy} from '@server/proxy'
const app = new Koa()
const router = new Router()
router.get('/', ctx => {
ctx.body = 'context'
})
router.get('/api/somefile', body(), proxy({
host: 'somehost',
method: 'POST',
type: 'stream',
filename: 'demo.xlsx'
}))
router.all('/api/*', body(), proxy({
debug: true,
host: 'https://api.github.com',
rewrite: {
'^/api': '',
},
// 处理 request option, option 可参考 request 官方文档
extend: (option, ctx) => {
// option: request option
option.headers.Authorization = `bearer ${ctx.state.token}`
}
}))
app.listen(3000)
option
interface Option {
host: string
method?: string
rewrite?: Object
extend?: Function
type?: string
filename?: string
debug?: Boolean
}
npm test
2019@ZKH-FE
FAQs
proxy
The npm package @nioh/proxy receives a total of 2 weekly downloads. As such, @nioh/proxy popularity was classified as not popular.
We found that @nioh/proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.