mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-17 07:39:21 +08:00
Change listener name
This commit is contained in:
parent
5bddd4463d
commit
84716b2161
@ -8,6 +8,7 @@ var twillioAccountSID =
|
|||||||
var twilio = require("twilio")(twillioAccountSID, twillioAuthToken);
|
var twilio = require("twilio")(twillioAccountSID, twillioAuthToken);
|
||||||
var express = require("express");
|
var express = require("express");
|
||||||
var app = express();
|
var app = express();
|
||||||
|
const fs = require('fs');
|
||||||
var http = require("http").createServer(app);
|
var http = require("http").createServer(app);
|
||||||
var io = require("socket.io")(http);
|
var io = require("socket.io")(http);
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
@ -80,9 +81,9 @@ io.on("connection", function (socket) {
|
|||||||
socket.join(room);
|
socket.join(room);
|
||||||
} else if (numClients < 5) {
|
} else if (numClients < 5) {
|
||||||
socket.join(room);
|
socket.join(room);
|
||||||
// When the client is not the first to join the room, all clients are ready.
|
logIt("Broadcasting request to connect with new peer...", room);
|
||||||
logIt("Broadcasting ready message", room);
|
// Emits message to ask peers in room to connect with joining peer
|
||||||
socket.broadcast.to(room).emit("willInitiateCall", socket.id, room);
|
socket.broadcast.to(room).emit("initiateCall", socket.id, room);
|
||||||
} else {
|
} else {
|
||||||
logIt(
|
logIt(
|
||||||
"room already full with " + numClients + " people in the room.",
|
"room already full with " + numClients + " people in the room.",
|
||||||
@ -132,7 +133,7 @@ io.on("connection", function (socket) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Listen for Heroku port, otherwise just use 3000
|
// Listen for Heroku port, otherwise just use 3000
|
||||||
var port = process.env.PORT || 3000;
|
var port = process.env.PORT || 443;
|
||||||
http.listen(port, function () {
|
http.listen(port, function () {
|
||||||
console.log("http://localhost:" + port);
|
console.log("http://localhost:" + port);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user