mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 14:56:38 +08:00
[优化] 增加断开 WebSocket 客户端的功能,优化连接管理
This commit is contained in:
@@ -150,6 +150,12 @@ func AgentWebSocket(c *gin.Context) {
|
||||
}()
|
||||
|
||||
slog.Debug("agent ws upgrade succeeded", "node_id", node.NodeID, "remote", c.Request.RemoteAddr)
|
||||
|
||||
go func() {
|
||||
<-client.Done()
|
||||
_ = conn.Close()
|
||||
}()
|
||||
|
||||
go streamAgentWSMessages(c, conn, client)
|
||||
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user