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

Implement HTTP CONNECT for HTTP/2 #250

Closed
jmcc0nn3ll opened this issue Feb 16, 2016 · 1 comment
Closed

Implement HTTP CONNECT for HTTP/2 #250

jmcc0nn3ll opened this issue Feb 16, 2016 · 1 comment
Assignees

Comments

@jmcc0nn3ll
Copy link
Contributor

migrated from Bugzilla #481459
status NEW severity enhancement in component http2 for 9.3.x
Reported in version 9.3.5 on platform PC
Assigned to: Simone Bordet

On 2015-11-04 16:48:22 -0500, Simone Bordet wrote:

https://tools.ietf.org/html/rfc7540#section-8.3

On 2016-01-07 15:18:18 -0500, Simone Bordet wrote:

See also https://tools.ietf.org/html/rfc7639

@sbordet
Copy link
Contributor

sbordet commented Mar 16, 2016

The issue is more complicated than initially thought.

After discussion with @gregw, need to check whether browsers already support it.
If so, then we need at least to have the server side working.

For the server side, the idea is that we change the HTTP parser to consider a CONNECT request to have an infinite request content, rather than being considered a request without content.
Similarly, it will have an infinite response content.
Then, ConnectHandler needs to be changed in a way that it reads content either via the request's InputStream or via the transport directly. In this way, the transport does the un-framing, so that the HTTP/1.1 transport does not do any un-framing (it will consider the request content to be delimited by EOF), while the HTTP/2 transport does the DATA un-framing (i.e. receives a DATA frame and passes its payload to the application - in this case to the ConnectHandler).
Similarly, ConnectHandler will receive content from the server and then either write it via the response OutputStream or directly via the transport, so that the HTTP/1.1 transport will just send the bytes as is, while the HTTP/2 transport will frame the bytes into DATA frames.

On the client side, things may be even more complicated. We would need to support mixed modes where the client needs to talk HTTP/2 to the forward proxy, but HTTP/1.1 to the server, or viceversa.
This hints for the client to support the transport dynamically, e.g. to choose the transport based on the ALPN protocol.

sbordet added a commit that referenced this issue Apr 9, 2019
Modified HTTP/2 implementation to support the CONNECT method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Apr 9, 2019
Implemented semantic defined by RFC 8441.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Apr 30, 2019
Modified HTTP/2 implementation to support the CONNECT method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Apr 30, 2019
Implemented semantic defined by RFC 8441.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue May 3, 2019
Modified HTTP/2 implementation to support the CONNECT method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue May 3, 2019
Implemented semantic defined by RFC 8441.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Jul 9, 2019
Implemented section 8.3 of RFC 7540.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 12, 2019
Implemented a few TODOs and improved logging.
Some small code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 13, 2019
Final modifications after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 13, 2019
Fixes #250 - Implement HTTP CONNECT for HTTP/2.

Modified HTTP/2 implementation to support the CONNECT method.
Implemented semantic defined by RFC 8441.
Implemented section 8.3 of RFC 7540.
Introduced HTTP2Client.streamIdleTimeout.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet closed this as completed Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants