diff --git a/bin/proxy b/bin/proxy index abb5133806640b6fc43070b15dbfe2b57de70cf5..68a0f65d5aaf72feb16e02fbfd5051f9359e1e02 100755 --- a/bin/proxy +++ b/bin/proxy @@ -33,5 +33,5 @@ var server = http.createServer(function (req, res) { }); }).listen(port, addy, function () { var a = server.address(); - console.log("lil' HTTP proxy running: http://" + a.address + ":" + a.port); + console.log("running on http://" + a.address + ":" + a.port); }); diff --git a/lib/http_forward.js b/lib/http_forward.js index 16b757703a8363567e85205f93d9a39fdbc5e857..59df8952d87cebab49fd23183f7f48412d6a1d2a 100644 --- a/lib/http_forward.js +++ b/lib/http_forward.js @@ -25,6 +25,7 @@ module.exports = function(dest, req, res, cb) { method: req.method, agent: false }, function(pres) { + res.statusCode = pres.statusCode; // forward along Content-Type and Content-Length, if available if (pres.headers.hasOwnProperty('content-type')) { diff --git a/lib/primary.js b/lib/primary.js index cefa8edafc75d2f3a3621ea5f176b27740748b3f..67f5d52cf65554bc9068e4e6f6a7ceb81865ffad 100644 --- a/lib/primary.js +++ b/lib/primary.js @@ -193,7 +193,7 @@ if (process.env['SHIMMED_PRIMARIES']) { publicKey: r.publicKey }; - winston.info("inserted primary info for '" + domain + "' into cache, pointed at '" + origin + "'"); + logger.info("inserted primary info for '" + domain + "' into cache, pointed at '" + origin + "'"); }); } diff --git a/scripts/run_locally.js b/scripts/run_locally.js index e7da1212a1c5c1df0a7bc7c2e35fed0523d94d74..41092e3d8837d67af5020b3197a74cd9f23fbb59 100755 --- a/scripts/run_locally.js +++ b/scripts/run_locally.js @@ -39,12 +39,19 @@ var daemonsToRun = { PORT: 10005, HOST: HOST }, + proxy: { + PORT: 10006, + HOST: HOST + }, browserid: { PORT: 10002, HOST: HOST } }; +// route outbound HTTP through our in-tree proxy to always test said codepath +process.env['HTTP_PROXY'] = HOST + ":10006"; + // all spawned process that use handle primaries should know about "shimmed" // primaries process.env['SHIMMED_PRIMARIES'] = "example.domain|http://" + HOST + ":10005|" + path.join(__dirname, "..", "example", "primary", ".well-known", "browserid");