1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2025-06-27 00:51:30 +02:00

Add cloudflared socket handler

This commit is contained in:
Louis Lam
2022-03-29 14:48:02 +08:00
parent 7d3cbff794
commit 44fb2a88f2
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,19 @@
const { checkLogin } = require("../util-server");
const prefix = "cloudflared_";
module.exports.cloudflaredSocketHandler = (socket) => {
socket.on(prefix + "start", async (callback) => {
try {
checkLogin(socket);
} catch (error) {
callback({
ok: false,
msg: error.message,
});
}
});
};