Skip to content

Commit

Permalink
Make SplitHTTP work under CF Argo (#3479)
Browse files Browse the repository at this point in the history
* Make SplitHTTP work under CF Argo

* Update hub.go

---------

Co-Authored-By: 风扇滑翔翼 <[email protected]>
  • Loading branch information
mmmray and Fangliding committed Jun 28, 2024
1 parent e4f9d03 commit 2fdd7c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions transport/internet/splithttp/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req

// magic header instructs nginx + apache to not buffer response body
writer.Header().Set("X-Accel-Buffering", "no")
// magic header to make the HTTP middle box consider this as SSE to disable buffer
writer.Header().Set("Content-Type", "text/event-stream")

writer.WriteHeader(http.StatusOK)
// send a chunk immediately to enable CDN streaming.
// many CDN buffer the response headers until the origin starts sending
Expand Down

0 comments on commit 2fdd7c1

Please sign in to comment.