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

Issue #250 - Implement HTTP CONNECT for HTTP/2. #3539

Merged
merged 23 commits into from Aug 13, 2019

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Apr 9, 2019

#250.

Modified HTTP/2 implementation to support the CONNECT method.

Signed-off-by: Simone Bordet simone.bordet@gmail.com

@sbordet
Copy link
Contributor Author

sbordet commented Apr 9, 2019

@lachlan-roberts this is a draft pull request where I started the work to support #250 and ultimately #3537.

@joakime
Copy link
Contributor

joakime commented Apr 9, 2019

Is there any value in doing the jetty-http2 specifics on jetty-9.4.x?

@sbordet
Copy link
Contributor Author

sbordet commented Apr 9, 2019

Right now the ConnectHandler is hardcoded on HTTP/1.1.
Changing it to support also HTTP/2 may be a breaking change.
Greg and I discussed in the past that it won't make much sense to have 2 different mechanisms (one per protocol) to support the same thing.
That's mainly the reason I'm targetting this for Jetty 10.

@joakime
Copy link
Contributor

joakime commented Apr 9, 2019

fair enough

@gregw
Copy link
Contributor

gregw commented Apr 18, 2019

I think this should be implemented with a Tunnel abstraction.
Rather than co-opting the connection upgrade mechanism for HTTP/1, the ConnectHandler or other handlers should be able to make specific Tunnels and then pass them to their transport (in a similar way to upgrade). The specific transport would then be responsible for running the tunnel - so for HTTP/1 it would create a TunnelConnection that wraps the Tunnel and do a real upgrade. For HTTP/2 the Tunnel instance would be set as the IStream attachment and the onData listener would just know how to deliver data frames to/from a Tunnel. We would then have a HttpChannelTunnel, WebSocketTunnel and ConnectTunnel which would be transport independent.

@sbordet sbordet force-pushed the jetty-10.0.x-250-http_connect_for_http2 branch from 452bbd0 to 7743708 Compare April 30, 2019 14:28
Modified HTTP/2 implementation to support the CONNECT method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Implemented semantic defined by RFC 8441.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet force-pushed the jetty-10.0.x-250-http_connect_for_http2 branch from 7743708 to 090ee92 Compare May 3, 2019 17:24
Implemented handling of client-side idle timeout.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@gregw
Copy link
Contributor

gregw commented Jun 13, 2019

@sbordet what is the status of this? Should we merge it for an alpha 10?

@sbordet
Copy link
Contributor Author

sbordet commented Jun 13, 2019

@gregw there is still work to do, hopefully I'll finish today.

@sbordet
Copy link
Contributor Author

sbordet commented Jun 13, 2019

@gregw nope, I got a bunch of test failures and things to review and polish, so this won't make it for 10alpha0.

sbordet and others added 8 commits July 1, 2019 16:57
Implemented handling of client-side idle timeout.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Implemented section 8.3 of RFC 7540.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
@sbordet sbordet marked this pull request as ready for review July 10, 2019 07:34
@gregw
Copy link
Contributor

gregw commented Jul 11, 2019

@sbordet CI test failed?

@gregw
Copy link
Contributor

gregw commented Jul 11, 2019

This is too big to review without a walk through. Let's do it tomorrow.

@sbordet
Copy link
Contributor Author

sbordet commented Jul 22, 2019

@sbordet CI test failed?

Yes the issue is the idle timeout race between the EndPoint connected to the proxy and the HTTP/2 stream that tunnels requests to the proxy onto that EndPoint.
If the HTTP/2 stream idle timeout wins, we correctly send a DATA frame with endStream=true to the proxy to close the tunnel.
If the EndPoint idle timeout wins, we wrongly send a RST_STREAM to the proxy.

Introduced HTTP2Client.streamIdleTimeout.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Implemented a few TODOs and improved logging.
Some small code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - certainly good enough to be merged to alpha jetty-10. Let's dogfood it from here.

Final modifications after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet merged commit a700907 into jetty-10.0.x Aug 13, 2019
@sbordet sbordet deleted the jetty-10.0.x-250-http_connect_for_http2 branch August 13, 2019 16:07
@gsusanto gsusanto mentioned this pull request Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants