diff --git a/transport/internet/splithttp/hub.go b/transport/internet/splithttp/hub.go index 5181b19b..1e586eef 100644 --- a/transport/internet/splithttp/hub.go +++ b/transport/internet/splithttp/hub.go @@ -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