mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-14 00:22:34 +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);
|
||||
}
|
||||
|
||||
const io = new Server(server, {path: basePath + '/socket.io'});
|
||||
const io = new Server(server, {path: basePath + 'socket.io'});
|
||||
module.exports.io = io;
|
||||
|
||||
// Must be after io instantiation
|
||||
|
@ -203,9 +203,9 @@ exports.entryPage = "dashboard";
|
|||
// Entry Page
|
||||
mainRouter.get("/", async (_request, response) => {
|
||||
if (exports.entryPage === "statusPage") {
|
||||
response.redirect("status");
|
||||
response.redirect(basePath + "status");
|
||||
} else {
|
||||
response.redirect("dashboard");
|
||||
response.redirect(basePath + "dashboard");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -67,11 +67,12 @@ export default {
|
|||
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, {
|
||||
transports: ["websocket"],
|
||||
path: urlBase + "/socket.io"
|
||||
path: basePath + "socket.io"
|
||||
});
|
||||
|
||||
socket.on("info", (info) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue