Change static assets and websocket interface to /sshwifty/assets and /sshwifty/socket. This should allow user to map Sshwifty to a subdirectory behind a reverse proxy

This commit is contained in:
NI
2019-12-06 18:58:59 +08:00
parent db52edff2f
commit 2356a7c155
3 changed files with 39 additions and 7 deletions

View File

@@ -65,6 +65,8 @@ const mainTemplate = `
<loading v-else :error="loadErr"></loading>
`.trim();
const socksInterface = "/sshwifty/socket";
function startApp(rootEl) {
const pageTitle = document.title;
@@ -149,7 +151,7 @@ function startApp(rootEl) {
r = "ws://";
}
r += location.host + "/socket";
r += location.host + socksInterface;
return r;
},
@@ -249,7 +251,7 @@ function startApp(rootEl) {
? null
: await this.getSocketAuthKey(privateKey, this.key);
let h = await xhr.head("/socket", {
let h = await xhr.head(socksInterface, {
"X-Key": authKey ? btoa(String.fromCharCode.apply(null, authKey)) : ""
});