Add HTTPS server (self-signed fallback), update frontend messages, and README

This commit is contained in:
Chandu
2026-07-05 13:23:54 -04:00
parent ac34e8f86a
commit 7a56c88907
4 changed files with 92 additions and 3 deletions

View File

@@ -165,7 +165,9 @@ async function checkMicrophonePermission() {
if (status.state === 'denied') {
if (microphoneHint) {
microphoneHint.innerHTML = '🔒 Microphone blocked for this site. To allow:\n• Click the lock icon in the address bar → Site settings → Microphone → Allow\n• Or open this app via http://localhost:3000 and re-grant permissions.'
// If the page was loaded over HTTP (not secure), recommend using HTTPS localhost:3443
const suggestedUrl = (location.protocol === 'http:') ? 'https://localhost:3443' : 'http://localhost:3000';
microphoneHint.innerHTML = `🔒 Microphone blocked for this site. To allow:\n• Click the lock icon in the address bar → Site settings → Microphone → Allow\n• Or open this app via ${suggestedUrl} and re-grant permissions.`
.replace(/\n/g, '<br>');
microphoneHint.style.display = 'block';
}
@@ -224,7 +226,8 @@ async function verifyServerReachability() {
throw new Error(`HTTP ${response.status}`);
} catch (error) {
console.error('Server reachability check failed:', error);
showStatus('Cannot reach the app server. Open the app via http://localhost:3000', 'error');
const openUrl = (location.protocol === 'http:') ? 'https://localhost:3443' : 'http://localhost:3000';
showStatus(`Cannot reach the app server. Open the app via ${openUrl}`, 'error');
logDev(`Server reachability failed: ${error?.message || error}`);
}
}