Skip to content

Commit ce68eb1

Browse files
committed
enhance(sse): add X-Accel-Buffering header
1 parent 1164aa4 commit ce68eb1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/notification/live.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ func Live(c *gin.Context) {
1111
c.Header("Content-Type", "text/event-stream")
1212
c.Header("Cache-Control", "no-cache")
1313
c.Header("Connection", "keep-alive")
14+
// https://stackoverflow.com/questions/27898622/server-sent-events-stopped-work-after-enabling-ssl-on-proxy/27960243#27960243
15+
c.Header("X-Accel-Buffering", "no")
1416

1517
evtChan := make(chan *model.Notification)
1618

install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ cat > "$DataPath/app.ini" << EOF
294294
PageSize = 10
295295
296296
[server]
297-
HOST = 0.0.0.0
298-
PORT = 9000
297+
Host = 0.0.0.0
298+
Port = 9000
299299
RunMode = release
300300
301301
[cert]

0 commit comments

Comments
 (0)