diff --git a/proxy.js b/proxy.js index 25aed6f..1ee66c6 100644 --- a/proxy.js +++ b/proxy.js @@ -135,6 +135,11 @@ Proxy.prototype.next_socket = function(cb) { self.sockets.push(sock); } + // no sockets left to process waiting requests + if (self.sockets.length === 0) { + return; + } + var wait = self.waiting.shift(); debug('processing queued cb'); if (wait) { diff --git a/server.js b/server.js index 33df9c7..c59cf37 100644 --- a/server.js +++ b/server.js @@ -199,6 +199,8 @@ module.exports = function(opt) { }); var server = bouncy(function(req, res, bounce) { + debug('request %s', req.url); + // if we should bounce this request, then don't send to our server if (maybe_bounce(req, res, bounce)) { return;