feat(web): Go W-G12 rooms, Redis session, and API keys

Add mode=room with room_key hub APIs, optional redis:// session
backend, and web_api_key_check (sha256 pepper:key) for anlian primitives.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-10 20:10:43 +08:00
1 parent 26955f4f36
commit 12d2c7be69
15 files changed
+541 -13

No files matched your search

+3
View File
@@ -12,6 +12,7 @@ const (
ModeEcho Mode = "echo"
ModeBroadcast Mode = "broadcast"
ModeDrain Mode = "drain"
ModeRoom Mode = "room"
)
// ParseMode mirrors Rust ws_hub::WsMode::parse.
@@ -26,6 +27,8 @@ func ParseMode(v any) Mode {
switch strings.TrimSpace(strings.ToLower(t)) {
case "broadcast", "广播":
return ModeBroadcast
case "room", "房间":
return ModeRoom
case "drain", "false", "0", "no", "drain_only":
return ModeDrain
default: