-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Dynamic selection of the transport to use based on ALPN on the client side #1350
Comments
@sbordet is there any plan to implement this issue? |
@nhenneaux we would like to have this implemented, yes. |
@sbordet ok fine, thanks for your feedback! If you need help please tell me |
@elyograg posted the same will on a different issue, see #1308 (comment). |
@sbordet Thanks for your assistance today. I had an impression that if I used HttpClient with HttpClientTransportOverHTTP2 and called setUseALPN(true) on the transport, that it might work with both protocols. But either that doesn't work or I've done something wrong. The chance of the latter is probably high -- I'm working with code that I didn't write and barely understand. The fact that this issue exists (and #1308 before it) has me thinking that there might not be any way to do it currently. |
@elyograg that is correct, there is no way to do it currently. An instance of You can partially workaround this by having two |
Hey, |
I have been working on this a bit, but had to put it aside for other stuff. |
Thoughts dump for future reference. The issue is currently complicated by the fact that we have (for historical reasons) When opening a connection, one The difference between a For example, a for a client to connect to originA it may need This is further complicated by existence of HTTP proxies (and support for HTTP The server-side The client-side has the same needs, plus the need of notifying the application that the connection completed (successfully or not). This requires a For example, creating a We would need to support the following "protocols":
Likely the concept of a @gregw comments? |
is WebSocket a protocol here? or just built into HTTP/1.1? |
WebSocket is a protocol for Have not looked at WS-over-H2 yet. I imagine Both good points though. |
Hi, right now https://github.com/apache/lucene-solr/tree/jira/http2 only care about H2C. From https://tools.ietf.org/html/rfc7540#section-3 It seems that h2c and old HTTP/1.1 is compatible with others. Does Jetty client support that kind of upgrade? |
What do you exactly mean by that? Currently |
Hi everyone! We would very much appreciate it if we could use one HttpClient for HTTP/1.1 and HTTP/2 connections. Thanks for the great client and keep up the good work! |
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Added javadocs and small changes after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Simplified ProxyProtocolClientConnectionFactory to use Origin.Address rather than InetSocketAddress. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
…t_transport Issue #1350 - Dynamic selection of the transport to use based on ALPN on the client side.
Major work for this issue has been merged in. |
HTTP/1 upgrade to HTTP/2 is tracked in #4382. |
I want to implement a JAX-RS client that support HTTP/1.1 and HTTP/2 for a JAX-RS client.
The idea is to use HTTP/2 if the server supports ALPN with HTTP/2 and uses HTTP/1.1 if the server does not provide any information.
I have read some articles about ALPN and it seems to be possible but I don't find anything supporting these protocol at the same time. I did not manage to plug these together.
I am currently using the Jetty HTTP/1.1 transport connector for Jersey and a custom implementation for HTTP/2 transport connector.
Could you implement this dynamic client selection as part of the Jetty project?
This issue is based on this StackOverflow question.
The text was updated successfully, but these errors were encountered: