From 61b64fdb0edba21279abf3c76256915491a93ccf Mon Sep 17 00:00:00 2001 From: Austin King Date: Wed, 27 Aug 2014 19:15:32 -0700 Subject: [PATCH] Fix error when closing and retrying transSslServer Currently we can hit a case where `server.close()` is called, but `server` is never defined. Looks like we want `transSslServer.close`. --- lib/proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/proxy.js b/lib/proxy.js index 7aaf018..392e790 100644 --- a/lib/proxy.js +++ b/lib/proxy.js @@ -414,8 +414,8 @@ module.exports.createProxyServer = function (opts) { if (e.code == 'EADDRINUSE') { console.log('Address in use, retrying...'); setTimeout(function () { - server.close(); - server.listen(opts['transSslPort'], hostname); + transSslServer.close(); + transSslServer.listen(opts['transSslPort'], hostname); }, 1000); } else { emitter.emit('error', e, 'transSslError');