feat(compute): add SPICE WebSocket console support

Add WebSocket-based console support for SPICE protocol, enabling
   browser-based graphical console access with enhanced features
   like clipboard sharing, USB redirection, and audio streaming.

   Changes:
   - Add start_spice_websocket_console() method in BaseNode for SPICE
     WebSocket to TCP bridging with bidirectional binary forwarding
   - Add /console/spice WebSocket endpoints in QEMU and Docker compute APIs
   - Add /console/spice WebSocket proxy endpoint in controller API
   - Add comprehensive API documentation in docs/features/

   Supported console types:
   - spice: Basic SPICE protocol support
   - spice+agent: SPICE with spice-vdagent for enhanced features

   Architecture:
   - Browser WebSocket → Controller (JWT + RBAC) → Compute (Basic Auth)
   - No external websockify processes required
   - Consistent with existing VNC WebSocket implementation
This commit is contained in:
YueGuobin committed 2026-03-16 22:21:25 +08:00
1 parent ba92b405da
commit c98f802362
5 files changed
+1046

No files matched your search

@@ -399,6 +399,21 @@ async def vnc_console_ws(
await node.start_vnc_websocket_console(websocket)
@router.websocket(
"/{node_id}/console/spice"
)
async def spice_console_ws(
websocket: Union[None, WebSocket] = Depends(ws_compute_authentication),
node: DockerVM = Depends(dep_node)
) -> None:
"""
SPICE Console WebSocket.
"""
if websocket:
await node.start_spice_websocket_console(websocket)
@router.post(
"/{node_id}/console/reset",
status_code=status.HTTP_204_NO_CONTENT,