Skip to content
Discussion options

You must be logged in to vote

Okay I was getting a million things mixed up but I think I've got it all sorted finally.

With the below config I can receive HTTP/2 requests over http:// requests, but I'm unable to send HTTP/2 requests to an upstream over http://. With the client described above, I get this error in the logs:

Connection is HTTP/1, but request requires HTTP/2

However if I use this client it works:

pub fn build_h2c_client() -> H2cClient {
    Client::builder(TokioExecutor::new())
        .http2_only(true)
        .build::<_, axum::body::Body>(hyper_tls::HttpsConnector::new())
}

So in summary, here's what you do.

Build two clients:

pub fn get_hyper_client_builder() -> Builder {
    Client::builder(TokioExe…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@banool
Comment options

@seanmonstar
Comment options

@banool
Comment options

@banool
Comment options

Answer selected by banool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants