diff --git a/public/js/chat.js b/public/js/chat.js index 488622a..69ce8a4 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -183,8 +183,8 @@ var VideoChat = { case "connected": logIt("connected"); // Once connected we no longer have a need for the signaling server, so disconnect - VideoChat.socket.off("token"); - VideoChat.socket.off("offer"); + // VideoChat.socket.off("token"); + // VideoChat.socket.off("offer"); break; case "disconnected": logIt("disconnected"); @@ -308,13 +308,6 @@ var VideoChat = { // Send ice candidate over websocket VideoChat.socket.emit("candidate", JSON.stringify(candidate), roomHash, uuid); }); - // Reset the buffer of local ICE candidates. This is not really needed, but it's good practice - // VideoChat.localICECandidates[uuid] = []; - // } else { - // console.log("attemped to run onAnswer on UUID ", uuid, " which already happened"); - // } - - }, // Called when a stream is added to the peer connection diff --git a/server.js b/server.js index 7b8865e..622fbd9 100644 --- a/server.js +++ b/server.js @@ -9,10 +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("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"); @@ -144,7 +145,7 @@ io.on("connection", function (socket) { }); // Listen for Heroku port, otherwise just use 3000 -var port = process.env.PORT || 443; +var port = process.env.PORT || 3000; http.listen(port, function () { console.log("http://localhost:" + port); });