From 4bda280782f41ee65047319001486973192ab8db Mon Sep 17 00:00:00 2001 From: doodeck Date: Mon, 2 Mar 2015 13:07:33 +0100 Subject: [PATCH] Added window.location to allow accessing from anywhere With this fix, you can serve the HTML/JS from any server, not only localhost, and still have the code connecting to the proper websocket. --- client/webrtc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/webrtc.js b/client/webrtc.js index 188fb43..9d8e536 100755 --- a/client/webrtc.js +++ b/client/webrtc.js @@ -12,7 +12,7 @@ function pageReady() { localVideo = document.getElementById('localVideo'); remoteVideo = document.getElementById('remoteVideo'); - serverConnection = new WebSocket('ws://127.0.0.1:3434'); + serverConnection = new WebSocket('ws://' + window.location.hostname + ':3434'); serverConnection.onmessage = gotMessageFromServer; var constraints = {