TUN-3480: Support SSE with http2 connection, and add SSE handler to hello-world server

This commit is contained in:
cthuang
2020-10-23 15:49:24 +01:00
parent 6b86f81c4a
commit eef5b78eac
7 changed files with 156 additions and 62 deletions

View File

@@ -99,7 +99,7 @@ func (c *client) proxyHTTP(w connection.ResponseWriter, req *http.Request) (*htt
return nil, errors.Wrap(err, "Error writing response header")
}
if isEventStream(resp) {
//h.observer.Debug("Detected Server-Side Events from Origin")
c.logger.Debug("Detected Server-Side Events from Origin")
c.writeEventStream(w, resp.Body)
} else {
// Use CopyBuffer, because Copy only allocates a 32KiB buffer, and cross-stream