一、前端 JavaScript 使用 WebSocket 1. 基本使用流程 // 1. 创建 WebSocket 连接 (ws:// 或 wss://)const socket = new WebSocket(\'ws://localhost:8000/...