enhance(sse): add X-Accel-Buffering header

This commit is contained in:
Jacky 2024-11-08 09:55:00 +08:00
parent 1164aa4020
commit ce68eb1658
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
2 changed files with 4 additions and 2 deletions

View file

@ -11,6 +11,8 @@ func Live(c *gin.Context) {
c.Header("Content-Type", "text/event-stream")
c.Header("Cache-Control", "no-cache")
c.Header("Connection", "keep-alive")
// https://stackoverflow.com/questions/27898622/server-sent-events-stopped-work-after-enabling-ssl-on-proxy/27960243#27960243
c.Header("X-Accel-Buffering", "no")
evtChan := make(chan *model.Notification)

View file

@ -294,8 +294,8 @@ cat > "$DataPath/app.ini" << EOF
PageSize = 10
[server]
HOST = 0.0.0.0
PORT = 9000
Host = 0.0.0.0
Port = 9000
RunMode = release
[cert]