forked from coolaj86/goldilocks.js
remoteAddress priority... and whitespace... ooops
This commit is contained in:
parent
4b470ffe51
commit
350d87c38d
|
@ -62,7 +62,7 @@ module.exports.create = function (deps, config) {
|
||||||
// XXX SECURITY XXX: should strip existing X-Forwarded headers
|
// XXX SECURITY XXX: should strip existing X-Forwarded headers
|
||||||
newHeads =
|
newHeads =
|
||||||
[ "X-Forwarded-Proto: " + (opts.encrypted ? 'https' : 'http')
|
[ "X-Forwarded-Proto: " + (opts.encrypted ? 'https' : 'http')
|
||||||
, "X-Forwarded-For: " + (conn.remoteAddress || opts.remoteAddress)
|
, "X-Forwarded-For: " + (opts.remoteAddress || conn.remoteAddress)
|
||||||
, "X-Forwarded-Host: " + hostname
|
, "X-Forwarded-Host: " + hostname
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -127,6 +127,8 @@ module.exports.create = function (deps, config) {
|
||||||
var packerStream = require('tunnel-packer').Stream;
|
var packerStream = require('tunnel-packer').Stream;
|
||||||
var myDuplex = packerStream.create(socket);
|
var myDuplex = packerStream.create(socket);
|
||||||
|
|
||||||
|
myDuplex.remoteAddress = opts.remoteAddress || myDuplex.remoteAddress;
|
||||||
|
myDuplex.remotePort = opts.remotePort || myDuplex.remotePort;
|
||||||
console.log('[tlsRouter] ' + address + ':' + port + ' servername', servername, myDuplex.remoteAddress);
|
console.log('[tlsRouter] ' + address + ':' + port + ' servername', servername, myDuplex.remoteAddress);
|
||||||
|
|
||||||
// needs to wind up in one of 3 states:
|
// needs to wind up in one of 3 states:
|
||||||
|
|
Loading…
Reference in New Issue