better log output, comment typo, var declaration in better place
This commit is contained in:
parent
90640ee8e7
commit
2f53e7fadb
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var escapeRe = require('escape-string-regexp');
|
var escapeRe = require('escape-string-regexp');
|
||||||
var insecureServer;
|
|
||||||
|
|
||||||
module.exports.create = function (securePort, insecurePort, redirects) {
|
module.exports.create = function (securePort, insecurePort, redirects) {
|
||||||
function redirectHttps(req, res) {
|
function redirectHttps(req, res) {
|
||||||
|
@ -76,13 +75,15 @@ module.exports.create = function (securePort, insecurePort, redirects) {
|
||||||
// and then hands control over completely to respawned server
|
// 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
|
// This simply redirects from the current insecure location to the encrypted location
|
||||||
//
|
//
|
||||||
|
var insecureServer;
|
||||||
insecureServer = http.createServer();
|
insecureServer = http.createServer();
|
||||||
insecureServer.on('request', redirectHttps);
|
insecureServer.on('request', redirectHttps);
|
||||||
insecureServer.listen(insecurePort, function () {
|
insecureServer.listen(insecurePort, function () {
|
||||||
console.log("\nRedirecting all http traffic to https\n");
|
console.log("\nListening on https://localhost:" + insecureServer.address().port);
|
||||||
|
console.log("(redirecting all traffic to https)\n");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue