Anybody an idea how to setup a websocket connection?
Following code does not work.. Been working on it already for 2 evenings:
$.get("http://ipminiserver
ort/jdev/sys/getkey?" + Math.random()).success(function (a) {var salt = a.LL.value;
function toHex(str) {
var hex = '';
for(var i=0;i<str.length;i++) {
hex += ''+str.charCodeAt(i).toString(16);
}
return hex;
}
var hex = toHex (a.LL.value);
var credentials = "admin:admin";
var shaObj = new jsSHA(credentials, "ASCII");
var hash = shaObj.getHMAC(hex, "HEX", "HEX");
var host = "ws://ipminiserver
ort/ws/";var socket = new WebSocket(host, hash);
socket.onopen = function(evt) { onOpen(evt) };
socket.onclose = function(evt) { onClose(evt) };
socket.onmessage = function(evt) { onMessage(evt) };
socket.onerror = function(evt) { onError(evt) };
});
. Have to say that I'm really getting frustrated about the fact loxone's support is below all levels about this...
Kommentar