mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Added support for both https AND http, config is now untracked by git
This commit is contained in:
1 parent
a9532dd0d3
commit
94bbf62c26
3 files changed
+37
-21
No files matched your search
@@ -911,15 +911,16 @@ app.get("/api/getFactorioLocale", function(req,res){
|
||||
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
||||
});
|
||||
});
|
||||
if(config.masterPort == 443){
|
||||
var privateKey = fs.readFileSync( 'privatekey.pem' );
|
||||
var certificate = fs.readFileSync( 'certificate.pem' );
|
||||
if(config.sslPort){
|
||||
var certificate = fs.readFileSync( 'database/certificates/cert.crt' );
|
||||
var privateKey = fs.readFileSync( 'database/certificates/cert.key' );
|
||||
|
||||
server = https.createServer({
|
||||
httpsServer = https.createServer({
|
||||
key: privateKey,
|
||||
cert: certificate
|
||||
}, app).listen(443);
|
||||
} else {
|
||||
}, app).listen(config.sslPort);
|
||||
}
|
||||
if(config.masterPort){
|
||||
server = require("http").Server(app);
|
||||
server.listen(config.masterPort || 8080, function () {
|
||||
console.log("Listening on port %s...", server.address().port);
|
||||
|
||||
Reference in new issue
Block a user