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

51
README.md Normal file
View File

@@ -0,0 +1,51 @@
# Voice Translator App
This app provides text translation, speech-to-text, and text-to-speech functionality. It runs an Express server and serves a single-page frontend.
HTTPS for microphone access
---------------------------------
Modern browsers require a secure context (HTTPS or localhost over HTTPS) for getUserMedia microphone access. This project can start an HTTPS server on `https://localhost:3443` using either your own certificate files or a generated self-signed certificate.
How to run
-----------
1. Install dependencies:
```bash
cd /Users/chadee/Ria
npm install
```
2. Start the server (HTTP + HTTPS):
```bash
npm start
```
This starts the HTTP server on `http://localhost:3000` and an HTTPS server on `https://localhost:3443`.
Using your own certificate
--------------------------
If you have SSL certificate and key files, set the following environment variables before starting the server:
```bash
export SSL_CERT_PATH=/path/to/cert.pem
export SSL_KEY_PATH=/path/to/key.pem
npm start
```
When no certificate is provided, the server generates a temporary self-signed certificate at runtime and serves HTTPS on `https://localhost:3443`.
Accepting the self-signed cert warning
------------------------------------
When using the generated self-signed certificate, your browser will show a security warning. To proceed:
- In Chrome/Edge/Brave: Click "Advanced" → "Proceed to localhost (unsafe)".
- In Firefox: Accept the risk and continue.
- In Safari: Go to System Settings → Privacy & Security → Certificates to trust the localhost certificate if needed.
After accepting the warning, open `https://localhost:3443` and allow microphone access when prompted. The site will run in a secure context and `getUserMedia` will work.
Notes
-----
- The server will log a warning when generating a temporary self-signed certificate.
- For production deployments use valid CA-signed certificates.