javascript - Creating Node.JS HTTPS server in Cloud9 IDE -
is somehow possible create node.js https server in cloud9 ide?
below example of simple https server setup in node.js.
var https = require('https'); var fs = require('fs'); var app = require('./app'); // ssl configuration var ca_names = ['cert-name_1', 'cert-name_2', 'cert-name_3']; var options = { key: fs.readfilesync('./folder/server.key'), cert: fs.readfilesync('./folder/server.crt'), ca: ca_names.map(function(n) { return fs.readfilesync('./eid/ca/' + n + '.crt'); }), //crl: ca_names.map(function(n) { return fs.readfilesync('/eid/ca/' + n + '.crl'); }), requestcert: false, rejectunauthorized: false }; var server = https.createserver(options, app); server.listen(process.env.port || 8081, process.env.ip || "0.0.0.0"); console.log('server listening on port: ' + process.env.port);
when try connect server getting following error:
"econnreset: request not proxied!"
i think problem trying listen both http , https. c9 works proxy need listen on http though trying use https. try not listening https , should work. (more info on this) but, if need https, in case can use proxy nginx internally proxy requests on https.(more info on this)enter link description here
Comments
Post a Comment