@dkx/http-middleware-proxy
v0.1.1
Published
Proxy middleware for @dkx/http-server
Downloads
8
Readme
DKX/Http/Middleware/Proxy
Proxy middleware for @dkx/http-server.
Installation
$ npm install --save @dkx/http-middleware-proxy
or with yarn
$ yarn add @dkx/http-middleware-proxy
Usage
const {Server} = require('@dkx/http-server');
const {proxyMiddleware} = require('@dkx/http-middleware-proxy');
const app = new Server;
const proxyOptions = {
host: 'http://example.com',
timeout: 5000,
passHeaders: ['X-Custom-header'],
passAllHeaders: true
};
app.use(proxyMiddleware(proxyOptions));
Only the host
option is required.