GUI -- Continued work on supporting GUI failover. WIP
- Thomas to complete.

Change-Id: I4ed40a0d5b0b48cd1d9fac175a1f66e81df7dacf
diff --git a/web/gui/src/main/webapp/app/fw/remote/urlfn.js b/web/gui/src/main/webapp/app/fw/remote/urlfn.js
index c2addef..6ec01b4 100644
--- a/web/gui/src/main/webapp/app/fw/remote/urlfn.js
+++ b/web/gui/src/main/webapp/app/fw/remote/urlfn.js
@@ -33,25 +33,25 @@
                 return secure ? protocol + 's' : protocol;
             }
 
-            function urlBase(protocol, port) {
+            function urlBase(protocol, port, host) {
                 return matchSecure(protocol) + '://' +
-                    $loc.host() + ':' + (port || $loc.port());
+                    (host || $loc.host()) + ':' + (port || $loc.port());
             }
 
             function httpPrefix(suffix) {
                 return urlBase('http') + suffix;
             }
 
-            function wsPrefix(suffix, wsport) {
-                return urlBase('ws', wsport) + suffix;
+            function wsPrefix(suffix, wsport, host) {
+                return urlBase('ws', wsport, host) + suffix;
             }
 
             function rsUrl(path) {
                 return httpPrefix(rsSuffix) + path;
             }
 
-            function wsUrl(path, wsport) {
-                return wsPrefix(wsSuffix, wsport) + path;
+            function wsUrl(path, wsport, host) {
+                return wsPrefix(wsSuffix, wsport, host) + path;
             }
 
             return {