Ver código fonte

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

Jacky 5 meses atrás
pai
commit
ce68eb1658
2 arquivos alterados com 4 adições e 2 exclusões
  1. 2 0
      api/notification/live.go
  2. 2 2
      install.sh

+ 2 - 0
api/notification/live.go

@@ -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)
 

+ 2 - 2
install.sh

@@ -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]