Browse Source

Add auto-detect of page protocol

pull/54/head
Amir Sanni 6 years ago
parent
commit
506331c51b
  1. 10
      js/comm.js

10
js/comm.js

@ -18,9 +18,17 @@ var myPC; @@ -18,9 +18,17 @@ var myPC;
var awaitingResponse;
var streamConstraints;
var myMediaStream;
let wsChat;
const room = getRoom();
const wsChat = new WebSocket("ws://localhost:8080/comm");
if(location.protocol === 'http:'){
wsChat = new WebSocket("ws://1410inc.xyz:8080/comm");
}
else{
wsChat = new WebSocket("wss://1410inc.xyz:8080/wss2/comm");
}
window.addEventListener('load', function(){
startCounter();//shows the time spent in room

Loading…
Cancel
Save