# 📱 LiveKit Voice AI - 局域网测试指南

## ⚠️ 关于 404 错误

LiveKit Server 本身**不内置 Web UI**，`/explore` 路径返回 404 是正常的。

## ✅ 可用的测试方式

### 方式一：LiveKit Playground（最简单）
手机浏览器访问:
```
https://livekit.io/playground
```

配置:
- **Server URL**: `ws://192.168.31.229:7880`
- **Token**: 使用下方命令获取

### 方式二：React Native App（功能完整）
```bash
cd /Users/leo/.hermes/workspace/livekit-agents/react-native-example
npx react-native run-ios --device
```

编辑 `MeetingApp.js`:
```javascript
const SERVER_URL = 'ws://192.168.31.229:7880';
const TOKEN='***';  // 从 gen_token.py 获取
```

### 方式三：Python SDK 测试
```bash
python3 /Users/leo/.hermes/workspace/livekit-agents/meeting_test.py
```

## 🔑 获取 Token

```bash
source ~/s2s-env/bin/activate
python3 /Users/leo/.hermes/workspace/livekit-agents/gen_token.py voice-ai-meeting phone-user
```

输出:
```
Room: voice-ai-meeting
Identity: phone-user
Token: eyJhbG...-J4s
Server URL: ws://192.168.31.229:7880
```

## 📡 网络信息

```
Mac IP:     192.168.31.229
LiveKit:    ws://192.168.31.229:7880
STT 服务:   http://192.168.31.229:8080
```

## 🐛 常见问题

| 问题 | 解决方案 |
|------|----------|
| Playground 连接失败 | 检查手机和 Mac 是否同一 WiFi |
| WebRTC 无法工作 | 使用 HTTPS/WSS 或 localhost |
| 防火墙拦截 | 临时关闭 macOS 防火墙测试 |

## 📊 服务状态

```
✅ Agent Worker:   PID 74404 (voice-ai-agent)
✅ FunASR STT:    localhost:8080 (healthy)
✅ LiveKit Server: localhost:7880 (Docker)
```

**推荐：使用 https://livekit.io/playground 快速测试**
