use websocket to check for oml

This commit is contained in:
j 2014-08-12 14:50:56 +02:00
parent ad5f6a584e
commit 2c5f9823f2

View file

@ -1,10 +1,15 @@
function load() { function load() {
var base = 'http://[::1]:9842', var base = '//[::1]:9842',
img = new Image(); ws = new WebSocket('ws:' + base + '/ws');
img.onload = function(event) { ws.onopen = function(event) {
document.location.href = base; document.location.href = 'http:' + base;
};
ws.onerror = function(event) {
ws.close();
};
ws.onclose = function(event) {
setTimeout(load, 500);
}; };
img.src = base + '/static/oxjs/build/Ox.UI/png/transparent.png?' + new Date;
}; };
function update() { function update() {