go icon indicating copy to clipboard operation
go copied to clipboard

x/net/http2: ability to access raw HTTP/2 stream

Open JensRantil opened this issue 6 years ago • 8 comments

I am interested in creating a HTTP proxy (note: not a reverse proxy) in Go. I'm only interested in implementing the CONNECT method. All other methods are irrelevant for me. https://github.com/elazarl/goproxy comes very close to what I want to do, but I'm also interested in supporting CONNECT when client is connected to proxy using HTTP/2. AFAIK, according to RFC7540, CONNECT over HTTP/2 should work by hijacking the stream and do TCP tunneling over it.

*http2responseWriter does not implement http.Hijacker. One idea, would be that it implements http.Hijacker which will give access not to the underlying TCP connection but rather the HTTP stream.

...or is there any other approach I could take without having to implement low-level HTTP/2 stuff?

JensRantil avatar Oct 13 '19 09:10 JensRantil