129 lines
3.2 KiB
Markdown
129 lines
3.2 KiB
Markdown
# SOLUCIÓN: LIVEKIT EN VPS SEPARADO + EASYPANEL
|
|
|
|
## 🏗️ ARQUITECTURA HÍBRIDA
|
|
|
|
```
|
|
┌─ EasyPanel ────────────────┐ ┌─ VPS Separado ─────────┐
|
|
│ │ │ │
|
|
│ OpenVidu Meet Backend ──────────→ LiveKit Server │
|
|
│ (HTTP/HTTPS only) │ │ (UDP 50000-60000) │
|
|
│ │ │ │
|
|
└────────────────────────────┘ └────────────────────────┘
|
|
↑ ↑
|
|
Traefik/SSL Firewall/UDP abierto
|
|
```
|
|
|
|
## 📋 CONFIGURACIÓN PASO A PASO
|
|
|
|
### 1. EasyPanel (Solo OpenVidu Meet Backend)
|
|
```yaml
|
|
# docker-compose.yml para EasyPanel
|
|
version: '3.8'
|
|
services:
|
|
openvidu-meet:
|
|
build: .
|
|
environment:
|
|
# LiveKit en VPS externo
|
|
LIVEKIT_URL: wss://livekit.tu-vps.com:7880
|
|
LIVEKIT_API_KEY: devkey
|
|
LIVEKIT_API_SECRET: tu-secret-32-chars
|
|
ports:
|
|
- "80:6080" # Solo HTTP - EasyPanel maneja SSL
|
|
```
|
|
|
|
### 2. VPS Separado (Solo LiveKit + Redis)
|
|
```yaml
|
|
# docker-compose.yml en VPS
|
|
version: '3.8'
|
|
services:
|
|
livekit:
|
|
image: livekit/livekit-server:latest
|
|
ports:
|
|
- "7880:7880" # API/WebSocket
|
|
- "50000-60000:50000-60000/udp" # WebRTC
|
|
volumes:
|
|
- ./livekit.yaml:/livekit.yaml
|
|
command: --config /livekit.yaml
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
command: redis-server --requirepass redispassword
|
|
```
|
|
|
|
### 3. Configuración LiveKit en VPS
|
|
```yaml
|
|
# livekit.yaml en VPS
|
|
port: 7880
|
|
bind_addresses: ["0.0.0.0"]
|
|
|
|
keys:
|
|
devkey: tu-secret-de-32-caracteres-minimo
|
|
|
|
redis:
|
|
address: "localhost:6379"
|
|
password: "redispassword"
|
|
|
|
rtc:
|
|
port_range_start: 50000
|
|
port_range_end: 60000
|
|
use_external_ip: true
|
|
external_ip: "IP_PUBLICA_DEL_VPS"
|
|
|
|
ice_servers:
|
|
- urls: ["stun:stun.l.google.com:19302"]
|
|
```
|
|
|
|
### 4. Firewall en VPS
|
|
```bash
|
|
# Configurar firewall en VPS
|
|
ufw allow 7880/tcp # LiveKit API
|
|
ufw allow 50000:60000/udp # WebRTC UDP
|
|
ufw allow 6379/tcp # Redis (si acceso externo)
|
|
ufw enable
|
|
```
|
|
|
|
### 5. SSL para LiveKit (Nginx en VPS)
|
|
```nginx
|
|
# /etc/nginx/sites-available/livekit
|
|
server {
|
|
listen 443 ssl;
|
|
server_name livekit.tu-vps.com;
|
|
|
|
ssl_certificate /path/to/cert.pem;
|
|
ssl_certificate_key /path/to/key.pem;
|
|
|
|
location / {
|
|
proxy_pass http://localhost:7880;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|
|
```
|
|
|
|
## 💰 COSTOS ESTIMADOS
|
|
|
|
### VPS para LiveKit:
|
|
- **Básico**: $5-10/mes (2GB RAM, 1 CPU)
|
|
- **Medio**: $15-25/mes (4GB RAM, 2 CPU)
|
|
- **Alto**: $30-50/mes (8GB RAM, 4 CPU)
|
|
|
|
### Proveedores recomendados:
|
|
- DigitalOcean
|
|
- Linode
|
|
- Hetzner
|
|
- Vultr
|
|
|
|
## ✅ VENTAJAS
|
|
- ✅ EasyPanel para web app (fácil)
|
|
- ✅ VPS dedicado para WebRTC (potencia)
|
|
- ✅ Escalabilidad independiente
|
|
- ✅ Control total sobre LiveKit
|
|
|
|
## ❌ DESVENTAJAS
|
|
- ❌ Costo adicional VPS
|
|
- ❌ Más complejidad de setup
|
|
- ❌ Mantenimiento de dos servicios |