Merge pull request #706 from 0xJacky/feat/sse-notify

enhance(sse): add X-Accel-Buffering header
This commit is contained in:
Jacky 2024-11-08 09:57:01 +08:00 committed by GitHub
commit 5698418f14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

@ -296,8 +296,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]