diff --git a/handler/device.go b/handler/device.go index 486be46..a072c44 100644 --- a/handler/device.go +++ b/handler/device.go @@ -8,6 +8,7 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/gorilla/websocket" + "io" "net/http" "strconv" "time" @@ -360,7 +361,7 @@ func VideoFeed(c *gin.Context) { // 创建一个通道用于接收客户端连接关闭的信号 clientClosed := make(chan struct{}) - c.Stream(func(w http.ResponseWriter) bool { + c.Stream(func(w io.Writer) bool { // 将读取 Redis 消息通道的逻辑放在这里,方便根据返回值控制循环 ch := pubSub.Channel() for {