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: handle CONNECT request #15336
As h2 spec : http://httpwg.org/specs/rfc7231.html#CONNECT
when we receive a CONNECT request, we should open a tcp connection to the target server identified in the :authority..and response to sender an 2XX, then pipe client connection and target server connection..
But in current h2: we can't response sender with and only with 2xx code,
Except that, h2-server always send 2xx and some headers to client after
Is there a recommend way to send client only one
You linked to the HTTP/1.1 spec (RFC 7231). The HTTP/2 spec's rules regarding CONNECT are in: http://httpwg.org/specs/rfc7540.html#CONNECT
You can use http.Flusher to write out a 200 response, and then you can bidirectional stream the request body and write the response body (with Flusher again).