gin
gin copied to clipboard
github.com/gin-contrib/gzip affects SSE not working
golang version: 1.20.3 github.com/gin-gonic/gin version: v1.9.1 github.com/gin-contrib/gzip version: v1.0.0
package main
import (
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"io"
"time"
)
func main() {
r := gin.Default()
r.Use(gzip.Gzip(gzip.DefaultCompression))
r.GET("/stream", func(c *gin.Context) {
c.Stream(func(w io.Writer) bool {
c.SSEvent("chat", time.Now().Format(time.RFC3339))
time.Sleep(1 * time.Second)
return true
})
})
r.Run(":9090")
}
I see the PR are fixed and merged, can we close this issue?