From 1821783dc810306d62e7a71f992778e861b70ffd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 27 Dec 2015 07:46:57 +1300 Subject: Support SSL WebSocket connection (fix #1624) --- web/app/controller/Root.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/app/controller') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 7978d1b1b..ff76268b3 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -84,7 +84,9 @@ Ext.define('Traccar.controller.Root', { }, asyncUpdate: function (first) { - var socket = new WebSocket('ws://' + window.location.host + '/api/socket'); + var protocol, socket; + protocol = location.protocol === 'https:' ? 'wss:' : 'ws:'; + socket = new WebSocket(protocol + window.location.host + '/api/socket'); socket.onmessage = function (event) { var i, store, data, array, entity; -- cgit v1.2.3