add server settings UI and enforcement

This commit is contained in:
Nystik
2026-06-06 17:05:26 +02:00
parent b43d12f702
commit a7824ac284
13 changed files with 497 additions and 33 deletions

View File

@@ -14,14 +14,10 @@ function setupWebSocket(server, opts = {}) {
throw new Error("setupWebSocket: opts.getVaultPath is required");
}
let originSet = toOriginSet(originAllowlist);
const originSet = toOriginSet(originAllowlist);
const wss = new WebSocketServer({ server, path: "/ws" });
wss.setOriginAllowlist = function (list) {
originSet = toOriginSet(list);
};
// Global message handlers: type -> handler(msg, ws).
wss.messageHandlers = new Map();