diff --git a/lib/insecure-server.js b/lib/insecure-server.js index aeaf8e8..2654b1e 100644 --- a/lib/insecure-server.js +++ b/lib/insecure-server.js @@ -2,7 +2,6 @@ var http = require('http'); var escapeRe = require('escape-string-regexp'); -var insecureServer; module.exports.create = function (securePort, insecurePort, redirects) { function redirectHttps(req, res) { @@ -76,13 +75,15 @@ module.exports.create = function (securePort, insecurePort, redirects) { // and then hands control over completely to respawned server // - // Redirect HTTP ot HTTPS + // Redirect HTTP to HTTPS // // This simply redirects from the current insecure location to the encrypted location // + var insecureServer; insecureServer = http.createServer(); insecureServer.on('request', redirectHttps); - insecureServer.listen(insecurePort, function(){ - console.log("\nRedirecting all http traffic to https\n"); + insecureServer.listen(insecurePort, function () { + console.log("\nListening on https://localhost:" + insecureServer.address().port); + console.log("(redirecting all traffic to https)\n"); }); };