mirror of
https://github.com/qemus/qemu-docker.git
synced 2025-10-06 15:56:58 +08:00
fix: Use relative paths for noVNC
This commit is contained in:
@@ -21,7 +21,7 @@ var webSocketFactory = {
|
||||
|
||||
function getInfo() {
|
||||
|
||||
var url = "/msg.html";
|
||||
var url = "msg.html";
|
||||
|
||||
try {
|
||||
if (window.XMLHttpRequest) {
|
||||
@@ -69,7 +69,12 @@ function processInfo() {
|
||||
|
||||
if (notFound) {
|
||||
setInfo("Connecting to VNC", true);
|
||||
var webSocket = webSocketFactory.connect("ws://" + window.location.host + "/websockify");
|
||||
|
||||
var protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
var path = window.location.pathname.replace(/[^/]*$/, '').replace(/\/$/, '');
|
||||
var wsUrl = protocol + "//" + window.location.host + path + "/websockify";
|
||||
var webSocket = webSocketFactory.connect(wsUrl);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user