feat(client): add ALPN h2 support for client connectors
- Adds `Connected::negotiated_h2()` method to signal the connection must use HTTP2. `Connect` implementations should set this if using ALPN. If a connection to a host is detected to have been upgraded via ALPN, any other oustanding connect futures will be canceled, and the waiting requests will make use of the single HTTP2 connection. The `http2_only` builder configuration still works the same, not requiring ALPN at all, and always using only a single connection.
This commit is contained in:
@@ -466,6 +466,7 @@ impl Builder {
|
||||
T: AsyncRead + AsyncWrite + Send + 'static,
|
||||
B: Payload + 'static,
|
||||
{
|
||||
trace!("client handshake HTTP/{}", if self.http2 { 2 } else { 1 });
|
||||
Handshake {
|
||||
builder: self.clone(),
|
||||
io: Some(io),
|
||||
|
||||
Reference in New Issue
Block a user