新增: df-relay Phase2 WS中继实现(Hello握手+鉴权+ConnRegistry配对路由+Event/Command方向分发)

This commit is contained in:
2026-06-22 01:47:01 +08:00
parent 2fe1fe57c8
commit 2b8b30ef41
5 changed files with 638 additions and 121 deletions

View File

@@ -20,7 +20,7 @@ pub enum RelayError {
#[error("广播失败: {0}")]
Broadcast(String),
/// WS 协议层错误(底层 tungstenite)
/// WS 协议层错误(底层 axum::extract::ws / tungstenite)
#[error("WS 协议错误: {0}")]
WebSocket(String),
@@ -28,6 +28,10 @@ pub enum RelayError {
#[error("消息序列化失败: {0}")]
Serde(#[from] serde_json::Error),
/// 广播发送失败(mpsc channel 对端已断开)
#[error("广播 channel 发送失败: {0}")]
Channel(String),
/// 其他未归类错误(降级通道)
#[error("中继内部错误: {0}")]
Other(#[from] anyhow::Error),