[minor] default enableXForwarded to true

This commit is contained in:
Dominic Tarr 2011-07-21 23:53:25 +10:00
parent 5d33ad7118
commit e3d95ecab2

View File

@ -341,7 +341,8 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
options = options || {}; options = options || {};
options.host = options.host || this.target.host; options.host = options.host || this.target.host;
options.port = options.port || this.target.port; options.port = options.port || this.target.port;
options.enableXForwarded = options.enableXForwarded || false; options.enableXForwarded =
(undefined === options.enableXForwarded ? true : options.enableXForwarded);
// //
// Check the proxy table for this instance to see if we need // Check the proxy table for this instance to see if we need
@ -589,7 +590,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
options = options || {}; options = options || {};
options.host = options.host || this.target.host; options.host = options.host || this.target.host;
options.port = options.port || this.target.port; // options.port = options.port || this.target.port;
if (this.proxyTable && !options.host) { if (this.proxyTable && !options.host) {
location = this.proxyTable.getProxyLocation(req); location = this.proxyTable.getProxyLocation(req);