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: ability to access raw HTTP/2 stream #34874

Open
JensRantil opened this issue Oct 13, 2019 · 6 comments
Open

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

JensRantil opened this issue Oct 13, 2019 · 6 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@JensRantil
Copy link

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?

@agnivade

This comment was marked as resolved.

@JensRantil
Copy link
Author

@agnivade Maybe I should have phrased it differently, then. See this as a feature request being able to access a raw stream in HTTP/2.

@agnivade
Copy link
Contributor

Ok.

@bradfitz

@agnivade agnivade reopened this Oct 13, 2019
@agnivade agnivade changed the title Be able to access raw HTTP/2 stream x/net/http2: ability to access raw HTTP/2 stream Oct 13, 2019
@agnivade agnivade added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 13, 2019
@Ice3man543
Copy link

Any updates on this? It'd be very useful to have in order to build proxies that work for HTTP/2 too!

@Impact-I

This comment has been minimized.

@golang golang locked and limited conversation to collaborators Jan 7, 2022
@golang golang unlocked this conversation Jan 7, 2022
@seankhliao seankhliao modified the milestones: Unplanned, Unreleased Aug 27, 2022
@becheran
Copy link

I am also interested in hijacking http2 streams for a tunnel solution based on individual http2 streams. Already created a fork which allows to hijack a http2 stream in the handle method https://github.com/becheran/net. I guess it would make sense to not use the original http.Hijacker interface but something stream specific instead to not be confused.

Will this ever be a feature in the http2 lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants