diff --git a/server.js b/server.js index 8c8ef2e..fcb793c 100644 --- a/server.js +++ b/server.js @@ -1059,6 +1059,27 @@ async function serveStatic(req, res) { } const server = http.createServer(async (req, res) => { + if (req.url?.startsWith('/.well-known/matrix/server')) { + res.writeHead(200, { + 'Content-Type': 'application/json; charset=utf-8', + 'Access-Control-Allow-Origin': '*' + }); + res.end(JSON.stringify({ "m.server": "matrix.mischlabs.de:443" })); + return; + } + + if (req.url?.startsWith('/.well-known/matrix/client')) { + res.writeHead(200, { + 'Content-Type': 'application/json; charset=utf-8', + 'Access-Control-Allow-Origin': '*' + }); + res.end(JSON.stringify({ + "m.homeserver": { "base_url": "https://matrix.mischlabs.de" }, + "org.matrix.msc3575.proxy": { "url": "https://matrix.mischlabs.de" } + })); + return; + } + if (req.url?.startsWith('/api/auth/config')) { if (req.method !== 'GET') { json(res, 405, { error: 'Method not allowed' });