summaryrefslogtreecommitdiff
path: root/examples/webchannel/standalone/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webchannel/standalone/index.html')
-rw-r--r--examples/webchannel/standalone/index.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/webchannel/standalone/index.html b/examples/webchannel/standalone/index.html
index 778a502..b5a9a49 100644
--- a/examples/webchannel/standalone/index.html
+++ b/examples/webchannel/standalone/index.html
@@ -11,7 +11,11 @@
output.innerHTML = output.innerHTML + message + "\n";
}
window.onload = function() {
- var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ if (location.search != "")
+ var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ else
+ var baseUrl = "ws://localhost:12345";
+
output("Connecting to WebSocket server at " + baseUrl + ".");
var socket = new WebSocket(baseUrl);