Skip to content

Commit b1aaef0

Browse files
author
Daniel Kutik
committed
Connect WebSocket relative to window.location
1 parent aa38365 commit b1aaef0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

example/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@
197197

198198
var room = window.location.hash.slice(1);
199199

200-
//When using localhost
201-
rtc.connect("ws://localhost:8000/", room);
200+
rtc.connect("ws:" + window.location.href.substring(window.location.protocol.length), room);
202201

203202
rtc.on('add remote stream', function(stream, socketId) {
204203
console.log("ADDING REMOTE STREAM...");

0 commit comments

Comments
 (0)