From a9f9e21eda2f8e912523e6b62abb0101c0353505 Mon Sep 17 00:00:00 2001 From: yawnt Date: Wed, 9 Oct 2013 17:37:20 +0200 Subject: [PATCH] [fix] --- lib/http-proxy/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js index 4faa3956b..7528f46e6 100644 --- a/lib/http-proxy/index.js +++ b/lib/http-proxy/index.js @@ -101,10 +101,11 @@ function ProxyServer(options) { ProxyServer.prototype.listen = function(port) { var self = this, - closure = function(req, res) { self.web(req, res); }, - this._server = options.ssl ? - https.createServer(this.options.ssl, closure) : - http.createServer(closure); + closure = function(req, res) { self.web(req, res); }; + + this._server = options.ssl ? + https.createServer(this.options.ssl, closure) : + http.createServer(closure); if(options.ws) { this._server.on('upgrade', function(req, socket, head) { self.ws(req, socket, head); });