Skip to content

Commit

Permalink
[api] Expose adapted version of stack so it can be used with HttpPr…
Browse files Browse the repository at this point in the history
…oxy instances not created by `httpProxy.createServer()`
  • Loading branch information
indexzero committed Aug 28, 2011
1 parent be3a0d8 commit 5d6e6b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/node-http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
//
Expand Down

0 comments on commit 5d6e6b9

Please sign in to comment.