forked from DGNum/gestioCOF
Protocole websocket K-Psul
- Si https, le protocole du websocket est wss - Sinon, ws
This commit is contained in:
parent
f502814d82
commit
f5e334afe0
|
@ -1065,7 +1065,8 @@ $(document).ready(function() {
|
||||||
|
|
||||||
websocket_msg_default = {'opegroups':[],'opes':[],'checkouts':[],'articles':[]}
|
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) {
|
socket.onmessage = function(e) {
|
||||||
data = $.extend({}, websocket_msg_default, JSON.parse(e.data));
|
data = $.extend({}, websocket_msg_default, JSON.parse(e.data));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue