diff --git a/public/chat.html b/public/chat.html index f3c95bb..70ce05e 100644 --- a/public/chat.html +++ b/public/chat.html @@ -23,7 +23,7 @@ Back Fullscreen Mute - Pause + diff --git a/public/landing/newroom.html b/public/landing/newroom.html index cb27560..7ee4c73 100755 --- a/public/landing/newroom.html +++ b/public/landing/newroom.html @@ -133,7 +133,7 @@ "hot", "cold", "warm", "hungry", "slow", "fast", "red", "white", "black", "blue", "green"]; var nouns = ["dog", "bat", "wrench", "apple", "pear", "ghost", "cat", "wolf", "squid", "goat", "snail", "hat", "sock", "plum", "bear", "snake", "turtle", "horse", "spoon", "fork", "spider", "tree", "chair", "table", - "couch", "towel"]; + "couch", "towel", "panda", "bread", "grape","cake","brick", "rat", "mouse"]; var adjective = adjectives[Math.floor(Math.random() * adjectives.length)]; var noun = nouns[Math.floor(Math.random() * nouns.length)]; noun = noun.charAt(0).toUpperCase() + noun.substring(1); diff --git a/server.js b/server.js index 368facf..c47fb34 100644 --- a/server.js +++ b/server.js @@ -8,6 +8,19 @@ var io = require('socket.io')(http); var path = require('path'); var public = path.join(__dirname, 'public'); +// Enforce HTTPS +app.use((req, res, next) => { + if (process.env.NODE_ENV === 'production') { + if (req.headers.host === 'neonchat.io') + return res.redirect(301, 'https://neonchat.io'); + if (req.headers['x-forwarded-proto'] !== 'https') + return res.redirect('https://' + req.headers.host + req.url); + else + return next(); + } else + return next(); +}); + app.use(express.static('public'));