mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-22 16:05:03 +08:00
attempt enforce https
This commit is contained in:
parent
92f10af3ad
commit
4a2ba4fa51
@ -23,7 +23,7 @@
|
|||||||
<a href="/landing" class="round-button">Back</a>
|
<a href="/landing" class="round-button">Back</a>
|
||||||
<a class="round-button" onclick="{openFullscreen()}">Fullscreen</a>
|
<a class="round-button" onclick="{openFullscreen()}">Fullscreen</a>
|
||||||
<a class="round-button" onclick="{muteMicrophone()}" id="muteButton">Mute </a>
|
<a class="round-button" onclick="{muteMicrophone()}" id="muteButton">Mute </a>
|
||||||
<a class="round-button" onclick="{pauseVideo()}" id="videoPauseButton">Pause </a>
|
<!-- <a class="round-button" onclick="{pauseVideo()}" id="videoPauseButton">Pause </a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
"hot", "cold", "warm", "hungry", "slow", "fast", "red", "white", "black", "blue", "green"];
|
"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",
|
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",
|
"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 adjective = adjectives[Math.floor(Math.random() * adjectives.length)];
|
||||||
var noun = nouns[Math.floor(Math.random() * nouns.length)];
|
var noun = nouns[Math.floor(Math.random() * nouns.length)];
|
||||||
noun = noun.charAt(0).toUpperCase() + noun.substring(1);
|
noun = noun.charAt(0).toUpperCase() + noun.substring(1);
|
||||||
|
13
server.js
13
server.js
@ -8,6 +8,19 @@ var io = require('socket.io')(http);
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var public = path.join(__dirname, 'public');
|
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'));
|
app.use(express.static('public'));
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user