Browse Source

Connect WebSocket relative to window.location

Daniel Kutik 11 years ago
parent
commit
b1aaef01a3
1 changed files with 1 additions and 2 deletions
  1. 1 2
      example/index.html

+ 1 - 2
example/index.html

@@ -197,8 +197,7 @@
 
         var room = window.location.hash.slice(1);
 
-        //When using localhost
-        rtc.connect("ws://localhost:8000/", room);
+        rtc.connect("ws:" + window.location.href.substring(window.location.protocol.length), room);
 
         rtc.on('add remote stream', function(stream, socketId) {
           console.log("ADDING REMOTE STREAM...");