From 586356c18a464bd2c0d7f0692cedb4bc12bf2d84 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Thu, 26 Dec 2024 13:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91=E6=B5=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/device.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {