# HG changeset patch # User John "Elwin" Edwards # Date 1342285873 25200 # Node ID dc1414faee19f5cb1bc7a725b36965f1b3b092b2 # Parent a9371002aecc2e8a0c967053b0a736485a99c325 RLG-Web client: determine the host for WebSocket connections. Construct the URLs for WebSocket connections using window.location.host instead of hardcoding them. diff -r a9371002aecc -r dc1414faee19 rlgterm.js --- a/rlgterm.js Sat Jul 14 09:46:26 2012 -0700 +++ b/rlgterm.js Sat Jul 14 10:11:13 2012 -0700 @@ -75,8 +75,6 @@ } }; -var wsHost = "localhost:8080"; - var session = { /* The session id assigned by the server. */ id: null, @@ -523,7 +521,7 @@ } if (statsock) return; - statsock = new WebSocket("ws://" + wsHost + "/status"); + statsock = new WebSocket("ws://" + window.location.host + "/status"); statsock.onmessage = function (ev) { var msg; try { @@ -742,7 +740,7 @@ } function wsWatch(gamenumber) { - var sockurl = "ws://" + wsHost + "/watch/" + String(gamenumber); + var sockurl = "ws://" + window.location.host + "/watch/" + String(gamenumber); var ws = new WebSocket(sockurl); ws.onopen = function (event) { session.id = true;