From 49dc9f05353a99c525eaac77ffdf6c81b0c8a99d Mon Sep 17 00:00:00 2001 From: Nikolaus Krismer <niko@krismer.de> Date: Wed, 19 Feb 2014 21:26:42 +0100 Subject: [PATCH] now calculating hard-coded webservice address (so the ws connection works on the development system and the demo machine) --- src/main/webapp/js/service/websocket.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/js/service/websocket.js b/src/main/webapp/js/service/websocket.js index cb5395ce..e38286e8 100644 --- a/src/main/webapp/js/service/websocket.js +++ b/src/main/webapp/js/service/websocket.js @@ -1,5 +1,11 @@ define(['jQuery', 'console'], function($, logger) { - var wsUri = 'ws://localhost:8090/isochrone/websocket'; + // Static fields + var currentUrl = window.location.href, + wsUri = null; + + currentUrl = currentUrl.substring(0, currentUrl.lastIndexOf('/') + 1); + wsUri = 'ws' + currentUrl.substring(currentUrl.indexOf(':')) + 'websocket'; + /** * This class is used to communicate with the server -- GitLab