auth header added

This commit is contained in:
ashubham 2015-03-12 13:15:06 -07:00
parent 245d73ae6c
commit ab5c3e5c81
2 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,7 @@ module.exports.createProxyServer =
* prependPath: <true/false, Default: true - specify whether you want to prepend the target's path to the proxy path>
* localAddress : <Local interface string to bind for outgoing connections>
* changeOrigin: <true/false, Default: false - changes the origin of the host header to the target URL>
* auth : Basic authentication i.e. 'user:password' to compute an Authorization header.
* hostRewrite: rewrites the location hostname on (301/302/307/308) redirects, Default: null.
* }
*

View File

@ -46,6 +46,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
extend(outgoing.headers, options.headers);
}
if(options.auth){
outgoing.auth = options.auth;
}
if (isSSL.test(options[forward || 'target'].protocol)) {
outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure;
}