net/http/httputil: ReverseProxy fails to proxy h2c #33452
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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
)?go env
OutputWhat did you do?
I am trying to test the behavior of h2c forwarding using httputil.Reverseproxy.
Wrote a repro-test: https://github.com/jaricftw/go-http2-reverseproxy/blob/master/http2_test.go#L25, which tests:
1). h2c client -> h2c Server
2). h2c client -> httputil.Reverseproxy -> h2c Server
What did you expect to see?
Both tests pass
What did you see instead?
or
With GODEBUG=http2debug=2 set:
It seems the reverseProxy successfully got the response from the backend server, but close the connection to the client before returning the response.
Am I missing anything, or httputil.Reverseproxy doesn't work with h2c? Thanks.
The text was updated successfully, but these errors were encountered: