feat(rustdesk): 完整实现RustDesk协议和P2P连接

重大变更:
- 从prost切换到protobuf 3.4实现完整的RustDesk协议栈
- 新增P2P打洞模块(punch.rs)支持直连和中继回退
- 重构加密系统:临时Curve25519密钥对+Ed25519签名
- 完善HID适配器:支持CapsLock状态同步和修饰键映射
- 添加音频流支持:Opus编码+音频帧适配器
- 优化视频流:改进帧适配器和编码器协商
- 移除pacer.rs简化视频管道

扩展系统:
- 在设置向导中添加扩展步骤(ttyd/rustdesk切换)
- 扩展可用性检测和自动启动
- 新增WebConfig handler用于Web服务器配置

前端改进:
- SetupView增加第4步扩展配置
- 音频设备列表和配置界面
- 新增多语言支持(en-US/zh-CN)
- TypeScript类型生成更新

文档:
- 更新系统架构文档
- 完善config/hid/rustdesk/video/webrtc模块文档
This commit is contained in:
mofeng-git
2026-01-03 19:34:07 +08:00
parent cb7d9882a2
commit 0c82d1a840
49 changed files with 5470 additions and 1983 deletions

View File

@@ -38,6 +38,20 @@ export enum HidBackend {
None = "none",
}
/** OTG USB device descriptor configuration */
export interface OtgDescriptorConfig {
/** USB Vendor ID (e.g., 0x1d6b) */
vendor_id: number;
/** USB Product ID (e.g., 0x0104) */
product_id: number;
/** Manufacturer string */
manufacturer: string;
/** Product string */
product: string;
/** Serial number (optional, auto-generated if not set) */
serial_number?: string;
}
/** HID configuration */
export interface HidConfig {
/** HID backend type */
@@ -48,6 +62,8 @@ export interface HidConfig {
otg_mouse: string;
/** OTG UDC (USB Device Controller) name */
otg_udc?: string;
/** OTG USB device descriptor configuration */
otg_descriptor?: OtgDescriptorConfig;
/** CH9329 serial port */
ch9329_port: string;
/** CH9329 baud rate */
@@ -470,11 +486,21 @@ export interface GostcConfigUpdate {
tls?: boolean;
}
/** OTG USB device descriptor configuration update */
export interface OtgDescriptorConfigUpdate {
vendor_id?: number;
product_id?: number;
manufacturer?: string;
product?: string;
serial_number?: string;
}
export interface HidConfigUpdate {
backend?: HidBackend;
ch9329_port?: string;
ch9329_baudrate?: number;
otg_udc?: string;
otg_descriptor?: OtgDescriptorConfigUpdate;
mouse_absolute?: boolean;
}
@@ -497,6 +523,7 @@ export interface RustDeskConfigUpdate {
enabled?: boolean;
rendezvous_server?: string;
relay_server?: string;
relay_key?: string;
device_password?: string;
}
@@ -549,3 +576,10 @@ export interface VideoConfigUpdate {
quality?: number;
}
export interface WebConfigUpdate {
http_port?: number;
https_port?: number;
bind_address?: string;
https_enabled?: boolean;
}