From f5e334afe0966629692bed581ebf27cfdccab4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 3 Sep 2016 16:07:33 +0200 Subject: [PATCH] Protocole websocket K-Psul - Si https, le protocole du websocket est wss - Sinon, ws --- kfet/templates/kfet/kpsul.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index b3b91aca..86665571 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -1065,7 +1065,8 @@ $(document).ready(function() { websocket_msg_default = {'opegroups':[],'opes':[],'checkouts':[],'articles':[]} - socket = new ReconnectingWebSocket("ws://" + window.location.host + "/ws/k-fet/k-psul/"); + var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws'; + socket = new ReconnectingWebSocket(websocket_protocol+"://" + window.location.host + "/ws/k-fet/k-psul/"); socket.onmessage = function(e) { data = $.extend({}, websocket_msg_default, JSON.parse(e.data));