Skip to content
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

x/net/http2: bidirection streams, let HTTP/2 server send response once it receives request header. #20287

Closed
JimmyCYJ opened this issue May 8, 2017 · 1 comment

Comments

@JimmyCYJ
Copy link

JimmyCYJ commented May 8, 2017

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?

@bradfitz

@bradfitz
Copy link
Contributor

bradfitz commented May 9, 2017

This already works. See #13444 etc. In particular #13444 (comment) has a demo.

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").

@bradfitz bradfitz closed this as completed May 9, 2017
@golang golang locked and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants