Skip to content

Commit f14de6f

Browse files
committed
make the websockifyUrl depend on the original location to make it customizable
1 parent 841bdcf commit f14de6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function status(text) {
4545
// This page is served under the /desktopvnc/, and the websockify websocket is served
4646
// under /desktop/ with the same base url as /desktopvnc/. We resolve it relatively
4747
// this way.
48-
let websockifyUrl = new URL("../desktop/", window.location);
48+
let websockifyUrl = new URL(window.location.pathname.replace(/vnc\/+$/, "/"), window.location);
4949
websockifyUrl.protocol = window.location.protocol === "https:" ? "wss" : "ws";
5050

5151
let retryCount = 0;

0 commit comments

Comments
 (0)