实现 WebRTC 数据通道管理器的 P2P 和 WS 中继模式支持,添加中继服务以处理 P2P 失败时的降级方案,更新相关接口和状态管理,增强错误处理和消息转发功能。

This commit is contained in:
MatrixSeven
2026-03-02 21:43:11 +08:00
parent 1a6a7369b9
commit ea73a9444f
9 changed files with 843 additions and 97 deletions

View File

@@ -53,6 +53,10 @@ func setupAPIRoutes(r *chi.Mux, h *handlers.Handler) {
r.Get("/api/ws/webrtc", h.HandleWebRTCWebSocket)
r.Get("/ws/webrtc", h.HandleWebRTCWebSocket)
// WebSocket 数据中继路由P2P降级方案
r.Get("/api/ws/relay", h.HandleRelayWebSocket)
r.Get("/ws/relay", h.HandleRelayWebSocket)
// WebRTC房间API
r.Post("/api/create-room", h.CreateRoomHandler)
r.Get("/api/room-info", h.WebRTCRoomStatusHandler)