-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http/httputil: ReverseProxy does not do well with streaming #27816
Comments
I have worked around this by wrapping the given |
@apoydence are you proposing any particular change to ReverseProxy? |
/cc @bradfitz as per the owners page. If you want to refactor the API or rewrite the proxy, I presume we could always do that in |
@mvdan If buffering could be turned off I think it would resolve the issue. |
I wonder how common something like this is desired/whether we would want to add a Boolean to the API for disabling buffering. |
@meirf I think that would be the best way to preserve existing the API. |
How about no new API and just do the right thing by default? e.g. https://go-review.googlesource.com/c/go/+/137335 |
Change https://golang.org/cl/137335 mentions this issue: |
@apoydence, there's a TODO in that CL for other cases. WebSockets is #26937. It doesn't work with ReverseProxy today. |
For posterity, I have worked around this by setting |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Use the
httputil.ReverseProxy
to proxy a SSE connection. The internal buffering done inside the proxy seemed to be causing the messages to be very latent and occasionally partial.What did you expect to see?
I expected the buffering to not cause partial messages or high latency.
What did you see instead?
Messages flushed in full.
The text was updated successfully, but these errors were encountered: