Protocole websocket K-Psul

- Si https, le protocole du websocket est wss
- Sinon, ws
This commit is contained in:
Aurélien Delobelle 2016-09-03 16:07:33 +02:00
parent f502814d82
commit f5e334afe0

View file

@ -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));