fix: websockify path (#153)

This commit is contained in:
Eric Paulsen 2022-05-02 10:54:08 -04:00 committed by GitHub
parent b9254682c1
commit f176f2d5fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,8 @@
// change the path depending on window.location (necessary for websockets to work on Coder's application path
// ex. /api/v0/workspaces/[id]/proxy/apps/desktop/)
path = window.location.pathname;
path = path.replace(/\/$/, "") + "/websockify";
path = path.replace(/^\/|\/$/g, "");
path = path + "/websockify";
console.log(path);
} else {
console.error("window.location.pathname is undefined");