diff --git a/transport/internet/splithttp/hub.go b/transport/internet/splithttp/hub.go index 5181b19bcf73..18aeb9ca095f 100644 --- a/transport/internet/splithttp/hub.go +++ b/transport/internet/splithttp/hub.go @@ -162,6 +162,8 @@ 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") writer.WriteHeader(http.StatusOK) + // magic header for cloudflared tunnel + writer.Header().Set("Content-Type", "text/event-stream") // send a chunk immediately to enable CDN streaming. // many CDN buffer the response headers until the origin starts sending // the body, with no way to turn it off.