From 5d6e6b9f78eb98b28db01490a36b23c1aade133f Mon Sep 17 00:00:00 2001 From: indexzero Date: Sun, 28 Aug 2011 01:18:53 -0400 Subject: [PATCH] [api] Expose adapted version of `stack` so it can be used with HttpProxy instances not created by `httpProxy.createServer()` --- lib/node-http-proxy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index eb722685f..e0a27e0c8 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -115,10 +115,10 @@ exports.setMaxSockets = function (value) { }; // -// stack +// ### function stack (middlewares, proxy) // adapted from https://github.com/creationix/stack // -function stack (middlewares, proxy) { +exports.stack = function stack (middlewares, proxy) { var handle; middlewares.reverse().forEach(function (layer) { var child = handle; @@ -206,7 +206,7 @@ exports.createServer = function () { } if (middleware.length > 1) { - handler = callback = stack(middleware, proxy); + handler = callback = exports.stack(middleware, proxy); } else if (middleware.length) { //