diff --git a/config.js.template b/config.js.template index 8e4598d..db6c94f 100644 --- a/config.js.template +++ b/config.js.template @@ -13,4 +13,6 @@ config.password = 'pepProxy'; config.check_permissions = false; +config.magic_key = undefined; + module.exports = config; \ No newline at end of file diff --git a/server.js b/server.js index d631c72..f229983 100644 --- a/server.js +++ b/server.js @@ -126,6 +126,19 @@ app.all('/*', function(req, res) { res.send(401, 'Auth-token not found in request header'); } else { + if (config.magic_key && config.magic_key === auth_token) { + var options = { + host: config.app_host, + port: config.app_port, + path: req.url, + method: req.method, + headers: proxy.getClientIp(req, req.headers) + }; + proxy.sendData('http', options, req.body, res); + return; + + } + var action, resource; if (config.check_permissions) {