diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-20 02:32:09 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-20 02:32:09 +1200 |
commit | 8a1d80d5f5ba8728573cb48495416b46ea4a4d6e (patch) | |
tree | 6f691943a8644dc0f4ec6735613573a112208fa7 /web | |
parent | ceef6b42312751b1f0d691cbefb171599f9ffed2 (diff) | |
download | trackermap-web-8a1d80d5f5ba8728573cb48495416b46ea4a4d6e.tar.gz trackermap-web-8a1d80d5f5ba8728573cb48495416b46ea4a4d6e.tar.bz2 trackermap-web-8a1d80d5f5ba8728573cb48495416b46ea4a4d6e.zip |
Fix a problem with websocket path
Diffstat (limited to 'web')
-rw-r--r-- | web/app/controller/Root.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index b5fa8450..9cd6fd6d 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -108,9 +108,10 @@ Ext.define('Traccar.controller.Root', { }, asyncUpdate: function (first) { - var protocol, socket, self = this; + var protocol, pathname, socket, self = this; protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - socket = new WebSocket(protocol + '//' + window.location.host + window.location.pathname + 'api/socket'); + pathname = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1); + socket = new WebSocket(protocol + '//' + window.location.host + pathname + 'api/socket'); socket.onclose = function (event) { self.asyncUpdate(false); |