-
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
Jetty 12 - HttpClientTransport network "modes" #8979
Comments
@lorban thoughts? |
Cannot be fixed in Jetty 12, could be in Jetty 13. |
@sbordet Gah, that's sad :( Okay, please confirm whether my understanding is correct then... In Jetty 12, the server should be able to bind all cleartext protocols on one port, and all encrypted protocols on a second port. This includes binding HTTP/2 and HTTP/3 to the same port, even though they require different connectors, because one binds to TCP/IP and the other to UDP. But on the client-side, there is no way to unify HTTP/2 and HTTP/3 support under a single HttpClient object. One has to use one HttpClient for all protocols excluding HTTP/3 and a second one specifically for HTTP/3 client requests. Is that correct? If so, then it's not really a big deal because my customers can still use interact with my server over HTTP/3. This just limits my unit tests and the server's outgoing connections to HTTP/2, which isn't the end of the world. I hope that's correct. Thank you. (so HTTP/2 and HTTP/3 encrypted connectors can be bound to the same port) but the same |
Correct.
Correct. The problem with the client is that a "normal" HTTP request has to be associated with a "transport layer" (for lack of better terminology). This transport layer can be:
All of that is complicated by the fact that the transport layer can be upgraded to a different protocol. The client is way more complicated than a server is, and the current situation is the result of the history: started with HTTP/1.1, then came HTTP/2, then UnixDomain socket and finally QUIC. Now imagine UDP over UnixDomain; and a local transport where a request is immediately passed to the server for example without even serializing it to bytes and parsing it. I know, all excuses, but we have not had time to sit down and re-design the lower layers for the client. |
graph TB;
TCP --- IP
UDP --- IP
TCP --- UNIX
UDP --- UNIX
TLS --- TCP
TLS ---- LOCAL
QUIC --- UDP
H1 --- TCP
H1 --- TLS
H1 --- QUIC
H1 --- LOCAL
H2 --- TCP
H2 --- TLS
H2 --- QUIC
H2 --- LOCAL
H3 --- QUIC
|
For the client, at connect time, we need two data: the "logical" address (e.g. The implementation must create either a SocketChannel (TCP) or a DatagramChannel (UDP), either over IP or UNIX, or it must fake this part to return a "local" equivalent. The combo [ TCP|UDP / IP|UNIX] can share a The current API uses The current API for UNIX only supports 1 server (yuck!) because the UNIX path is specified at the ProposalA proposal to abstract the combo [ TCP | UDP | IP | UNIX | LOCAL] would be to have an interface EvolutionFor SCTP for example, we would have For the lowest level there can be IPX or APPLETALK or ISDN, etc. (see |
* Introduced oej.io.TransportProtocol as the abstraction for the low-level transport of high-level protocols. Now protocols such as HTTP/1.1 or HTTP/2 can be transported over QUIC, Unix-Domain, memory, and possibly over other low-level custom protocols too. * Introduced oej.client.Request.transportProtocol(TransportProtocol) to specify TransportProtocol for each request. * Introduced TransportProtocol to [HTTP2Client|HTTP3Client].connect(...) methods. * Introduced [Client|Server]QuicConfiguration so that it can be used in other Connectors such as MemoryConnector. * Introduced oej.server.MemoryConnector and EndPoint.Pipe for memory communication between peers, along with a MemoryTransportProtocol. * Introduced QuicTransportProtocol as a wrapper for other TransportProtocols, so that QUIC can now also be transported over memory. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Introduced oej.io.Transport as the abstraction for the low-level transport of high-level protocols. Now protocols such as HTTP/1.1 or HTTP/2 can be transported over TCP, QUIC, Unix-Domain, memory, and possibly over other low-level custom protocols too. * Introduced oej.client.Request.transport(Transport) to specify Transport for each request. * Introduced Transport to [HTTP2Client|HTTP3Client].connect(...) methods. * Introduced [Client|Server]QuicConfiguration so that it can be used in other Connectors such as MemoryConnector. * Introduced oej.server.MemoryConnector and EndPoint.Pipe for memory communication between peers, along with a MemoryTransport. * Introduced QuicTransport as a wrapper for other Transports, so that QUIC can now also be transported over memory. * Improved javadocs and documentation. * Removed usage of ClientConnector.forUnixDomain() from FastCGIProxyServlet (ee10 and ee9). * Replaced usage of HTTP3ServerConnector with QuicServerConnector in jetty-http3.xml. * Fixed handling of Instruction notifications in case of re-entrance. Now first clear the list, then notify to avoid that when re-entering the same instruction is notified multiple times. * Introduced ContentSourceRequestContent, and updated ProxyHandler to use it. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Jetty version(s)
12+
Description
With support for UnixDomain sockets and QUIC,
ClientConnector
has now become too coarse, because it won't be possible to setup aHttpClientTransportDynamic
for "mixed" transports such as HTTP/1.1 over UnixDomain, HTTP/2 over TCP and HTTP/3 over QUIC.There is the need for a better abstraction than
ClientConnector
(or improve it), so that the above combination would be possible.The text was updated successfully, but these errors were encountered: