mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-14 16:42:35 +02:00
fix socket.io path
This commit is contained in:
parent
c8d729883c
commit
c165f6cad9
2 changed files with 6 additions and 5 deletions
|
@ -123,7 +123,7 @@ if (sslKey && sslCert) {
|
||||||
server = http.createServer(app);
|
server = http.createServer(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
const io = new Server(server, {path: basePath + '/socket.io'});
|
const io = new Server(server, {path: basePath + 'socket.io'});
|
||||||
module.exports.io = io;
|
module.exports.io = io;
|
||||||
|
|
||||||
// Must be after io instantiation
|
// Must be after io instantiation
|
||||||
|
@ -203,9 +203,9 @@ exports.entryPage = "dashboard";
|
||||||
// Entry Page
|
// Entry Page
|
||||||
mainRouter.get("/", async (_request, response) => {
|
mainRouter.get("/", async (_request, response) => {
|
||||||
if (exports.entryPage === "statusPage") {
|
if (exports.entryPage === "statusPage") {
|
||||||
response.redirect("status");
|
response.redirect(basePath + "status");
|
||||||
} else {
|
} else {
|
||||||
response.redirect("dashboard");
|
response.redirect(basePath + "dashboard");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -67,11 +67,12 @@ export default {
|
||||||
wsHost = protocol + location.host;
|
wsHost = protocol + location.host;
|
||||||
}
|
}
|
||||||
|
|
||||||
const urlBase = document.querySelector("head base").getAttribute("href");
|
// always starts and ends with '/'
|
||||||
|
const basePath = document.querySelector("head base").getAttribute("href");
|
||||||
|
|
||||||
socket = io(wsHost, {
|
socket = io(wsHost, {
|
||||||
transports: ["websocket"],
|
transports: ["websocket"],
|
||||||
path: urlBase + "/socket.io"
|
path: basePath + "socket.io"
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("info", (info) => {
|
socket.on("info", (info) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue