rust-eventsource-client icon indicating copy to clipboard operation
rust-eventsource-client copied to clipboard

Discussion: Are connections re-used + HTTP 1/2 support

Open michaelfeil opened this issue 6 months ago • 3 comments

Hey all,

just came across this project from this discussion: https://github.com/seanmonstar/reqwest/issues/2677 .

A couple of quick questions

  • is hyper re-useing the connection for http1.
  • are http2 connections multiplexed?
  • are http1 handshakes reused? https://github.com/seanmonstar/reqwest/blob/5b705ccc6bed87f8bf1b6a980049c6764ffdf493/src/async_impl/client.rs#L952

michaelfeil avatar Jul 16 '25 23:07 michaelfeil

Good morning. Sorry for the delay in response. Hope this helps.

is hyper re-useing the connection for http1.

The default hyper client maintains a connection pool, regardless of the connector used, so yes, it should be re-using the connection.

are http2 connections multiplexed?

By default, our crate enables hyper-rustls/http2 support, which does multiplexing of requests.

are http1 handshakes reused?

Yes, I believe this is the case.

keelerm84 avatar Jul 24 '25 14:07 keelerm84

This issue is marked as stale because it has been open for 30 days without activity. Remove the stale label or comment, or this will be closed in 7 days.

github-actions[bot] avatar Aug 24 '25 02:08 github-actions[bot]

@keelerm84 It does not work out of the box, you need to pass in a hyper client.

michaelfeil avatar Aug 25 '25 15:08 michaelfeil