mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 16:41:52 +08:00
feat(webrtc): 添加公共ICE服务器支持和优化HID延迟
- 重构ICE配置:将TURN配置改为统一的ICE配置,支持STUN和多TURN URL - 添加公共ICE服务器:类似RustDesk,用户留空时使用编译时配置的公共服务器 - 优化DataChannel HID消息:使用tokio::spawn立即处理,避免依赖webrtc-rs轮询 - 添加WebRTCReady事件:客户端等待此事件后再建立连接 - 初始化时启动音频流,确保WebRTC可订阅 - 移除多余的trace/debug日志减少开销 - 更新前端配置界面支持公共ICE服务器显示
This commit is contained in:
@@ -321,13 +321,26 @@ pub struct AppState {
|
||||
│ └─────────────────────────────────────────────────────────────────────┘ │
|
||||
└───────────────────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
├──────────────────────────────────────────┐
|
||||
│ │
|
||||
▼ ▼
|
||||
┌───────────────────┐ ┌───────────────────┐
|
||||
│ MJPEG Streamer │ │ WebRTC Streamer │
|
||||
│ (HTTP Stream) │ │ (RTP Packets) │
|
||||
└───────────────────┘ └───────────────────┘
|
||||
├──────────────────────────────┬──────────────────────────────┐
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
|
||||
│ MJPEG Streamer │ │ WebRTC Streamer │ │ RustDesk Service │
|
||||
│ (HTTP Stream) │ │ (RTP Packets) │ │ (P2P Stream) │
|
||||
│ │ │ │ │ │
|
||||
│ - HTTP/1.1 │ │ - DataChannel │ │ - TCP/UDP Relay │
|
||||
│ - multipart/x- │ │ - SRTP │ │ - NaCl Encrypted │
|
||||
│ mixed-replace │ │ - ICE/STUN/TURN │ │ - Rendezvous │
|
||||
└───────────────────┘ └───────────────────┘ └───────────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌───────────────────────────────────────────────────────────────────────────┐
|
||||
│ Clients │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
||||
│ │ Browser │ │ Browser │ │ RustDesk Client │ │
|
||||
│ │ (MJPEG) │ │ (WebRTC) │ │ (Desktop/Mobile) │ │
|
||||
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
|
||||
└───────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### 4.3 OTG 服务架构
|
||||
|
||||
Reference in New Issue
Block a user