mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] handle ws/wss
This commit is contained in:
parent
65f68d7c8b
commit
7fdd4276bb
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
function websocketPrefix() {
|
||||
if (window.location.protocol == "https:") {
|
||||
return "wss"
|
||||
} else {
|
||||
return "ws"
|
||||
}
|
||||
}
|
||||
|
||||
/* ansi_up.js
|
||||
* author : Dru Nelson
|
||||
* license : MIT
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
}
|
||||
})
|
||||
|
||||
ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/index-ws');
|
||||
ws = new WebSocket(websocketPrefix() + '://' + document.domain + ':' + location.port + '/index-ws');
|
||||
|
||||
ws.onmessage = function (event) {
|
||||
var message = JSON.parse(event.data);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
}
|
||||
})
|
||||
|
||||
ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/job-<{ job.id }>-ws');
|
||||
ws = new WebSocket(websocketPrefix() + '://' + document.domain + ':' + location.port + '/job-<{ job.id }>-ws');
|
||||
|
||||
ws.onmessage = function (event) {
|
||||
var message = JSON.parse(event.data);
|
||||
|
|
Loading…
Add table
Reference in a new issue