diff --git a/main.js b/main.js index 425fa15..ebbd7ed 100644 --- a/main.js +++ b/main.js @@ -103,7 +103,7 @@ cmdApp.get('/__tauri_cmd/:cmd', (req, res) => { sendToTauri('tauri-cmd', { cmd: req.params.cmd, url: req.query.url, window: req.query.window }); res.sendStatus(200); }); -cmdApp.listen(4892, () => debugLog("[CMD-SERVER] Dedicated command server listening on port 4892")); +cmdApp.listen(4892, '127.0.0.1', () => debugLog("[CMD-SERVER] Dedicated command server listening on port 4892")); process.stdin.resume(); process.stdin.on('end', () => { @@ -350,8 +350,8 @@ async function start() { tempApp.get('/update/info', (req, res) => { res.json({ available: true, current: localVersion, latest: release.version }); }); - const handleYes = (req, res) => { userDecision = true; res.sendStatus(200); }; - const handleNo = (req, res) => { userDecision = false; res.sendStatus(200); }; + const handleYes = (req, res) => { debugLog("tempApp received YES"); userDecision = true; res.sendStatus(200); }; + const handleNo = (req, res) => { debugLog("tempApp received NO"); userDecision = false; res.sendStatus(200); }; tempApp.all('/update/yes', handleYes); tempApp.all('/update/install', handleYes); @@ -365,7 +365,7 @@ async function start() { }); const tempServer = await new Promise((resolve) => { - const s = tempApp.listen(4891, () => resolve(s)); + const s = tempApp.listen(4891, '127.0.0.1', () => resolve(s)); s.on('error', (err) => { debugLog(`Update server bind error: ${err.message}`); resolve(null); @@ -480,10 +480,10 @@ async function start() { const FRONTEND_PORT = 4890; expressApp.use('/build', express.static(path.join(__dirname, 'build'))); - expressServer = expressApp.listen(FRONTEND_PORT, () => { + expressServer = expressApp.listen(FRONTEND_PORT, '127.0.0.1', () => { sendToTauri('status', { message: 'All backend services running and healthy.' }); debugLog("Frontend Express running on 4890. Sending READY to Tauri."); - sendToTauri('ready', { url: `http://localhost:${FRONTEND_PORT}` }); + sendToTauri('ready', { url: `http://127.0.0.1:${FRONTEND_PORT}` }); }); } catch (error) { diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f46a891..12a3862 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -448,7 +448,7 @@ const LINK_HANDLER_SCRIPT: &str = logoBtn.onclick = (e) => { e.preventDefault(); e.stopPropagation(); - window.location.href = 'http://localhost:4890'; + window.location.href = 'http://127.0.0.1:4890'; }; }