I saw a youtube video describing how it is important to redirect port 80 to another port (3000 for example). I learned how to implement a https (443 I believe) with certificate ssl validation. It is pretty cool and all but I just thought: "don't I need to redirect that port just like 80 (http)?"
Thanks in advance! Also, if I am using node/express, how would I determine how my user is connecting? On my server.js, I use https npm module with the certificate and key stuff. However, if all my connections are from port 3000 from my servers' point of view. Wouldn't this implementation be pointless?
server.js
var app = require('app');
var http = require('http');
var https = require('https');
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
var privatekey = fs.readFileSync('keys/personal/key', 'utf8');
var certificate = fs.readFileSync('leys/cert.crt', 'utf8');
var credentials = {key: privatekey, cert: certificate};
var server = http.createServer(app);
var httpsS = https.createServer(credentials, app);
server.listen(port);
httpsS.listen(443);
via DeadSupra
No comments:
Post a Comment