From 6774c1c5e539de0a04eaea1764dc7e89f0ad34f7 Mon Sep 17 00:00:00 2001 From: Khush Jammu Date: Sat, 30 May 2020 18:07:47 +0800 Subject: [PATCH] enabled https --- server.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server.js b/server.js index 622fbd9..7e8407c 100644 --- a/server.js +++ b/server.js @@ -9,11 +9,11 @@ var twilio = require("twilio")(twillioAccountSID, twillioAuthToken); var express = require("express"); var app = express(); const fs = require('fs'); -// var http = require("https").createServer({ -// key: fs.readFileSync('/Users/khushjammu/certs/privkey.pem'), -// cert: fs.readFileSync('/Users/khushjammu/certs/cert.pem') -// }, app); -var http = require("http").createServer(app); +var http = require("https").createServer({ + key: fs.readFileSync('/Users/khushjammu/certs/privkey.pem'), + cert: fs.readFileSync('/Users/khushjammu/certs/cert.pem') +}, app); +// var http = require("http").createServer(app); var io = require("socket.io")(http); var path = require("path"); var public = path.join(__dirname, "public"); @@ -92,7 +92,7 @@ io.on("connection", function (socket) { // Existing callers initiates call with user } }); - } else if (numClients < 3) { + } else if (numClients < 4) { socket.join(room); logIt("Connected clients", room) for (var clientId in clients.sockets) { @@ -145,7 +145,7 @@ io.on("connection", function (socket) { }); // Listen for Heroku port, otherwise just use 3000 -var port = process.env.PORT || 3000; +var port = process.env.PORT || 443; http.listen(port, function () { console.log("http://localhost:" + port); });