diff --git a/lib/modules/http.js b/lib/modules/http.js index 11258f1..72092b3 100644 --- a/lib/modules/http.js +++ b/lib/modules/http.js @@ -202,10 +202,12 @@ module.exports.create = function (deps, conf, greenlockMiddleware) { socket.end(); } + var prs = proxyRoutes.slice(); function proxyWs() { - var proxyRoute = proxyRoutes.shift(); + var proxyRoute = prs.shift(); if (!proxyRoute) { socket.end(); + return; } proxyRoute.ws(req, socket, head, proxyWs); }