kroxy
v0.4.0
Published
HTTP proxy middleware of Koa.
Downloads
7
Readme
kroxy
HTTP proxy middleware of Koa.
Install
$ npm install --save kroxy
Usage
app.use(kroxy([options]))
Options
All options are default false.
trustRequestBody
If enabled andcontext.request.body
exists, use it as the body of request.parseResponseBody
If enabled,context.response.body
are parsed intoBuffer
, otherwise stream.
Example
const http = require('http')
const koa = require('koa')
const kroxy = require('kroxy')
const app = koa()
app.use(kroxy()) // HTTP forward proxy
const server = http.createServer()
server.on('request', app.callback())
server.on('connect', kroxy.tunnel()) // HTTP tunnel proxy
License
MIT