exframe-proxy
v1.0.10
Published
exframe-proxy description
Downloads
46
Readme
exframe-proxy
Wraps http-proxy
Usage
const Proxy = require('exframe-proxy');
const { proxyRestRequest } = Proxy(configuration);
Configuration Settings
Configuration supports all options found within http-proxy, listed here: https://github.com/http-party/node-http-proxy#options
Methods
proxyRestRequest
Starts polling the database for actions that need to be executed.
proxyRestRequest(req, res, { target: 'http://localhost:3001' });
Arguments:
- req Request A Request object
- res Response A Response object
- httpProxyOptions Object The same arguments listed above in Configuration Settings are available to pass in here
- Note: changeOrigin defaults to
true
- Note: changeOrigin defaults to
getProxyHeaders
Expects a request as an input and outputs a dictionary of the following headers if they exist on the request.
- Content-Type
- Content-Encoding
- Content-Language
- Content-Location
const { getProxyHeaders } = Proxy(configuration);
const headers = getProxyHeaders(req);
Arguments
- req Request A Request object