Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/net/http2: bidirection streams, let HTTP/2 server send response once it receives request header. #20287
I am trying to set up a test environment client--HTTP/2-->proxy--HTTP/2-->server. The client sends a POST request that contains a large body, and the response also contains a large body. I need the server to start sending response as soon as it receives POST request header, so that both sides are sending data to each other concurrently. Is it possible to add a function into server to support sending early response?
There's a live demo at https://http2.golang.org/ (see the /ECHO handler linked there) that streams its input back capitalized.
That demo code is https://github.com/golang/net/blob/master/http2/h2demo/h2demo.go (search for "echo").