Skip to content

Implement experimental HTTP3 support #746

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged

Conversation

gseddon
Copy link

@gseddon gseddon commented Jun 2, 2025

Uses the h3 library to implement HTTP3 support. Added to all paths - debug, 'standard' and 'fast'. Initial integration test support, however needs more tests to be fully fleshed out.

While H1 and H2 are supported by higher-level abstractions in Hyper, Hyper doesn't have those equivalents for H3 yet. So we must write them ourselves. We have implemented only as much as is necessary for load testing.

This is titled 'experimental' because the H3 crate is still marked as 'experimental'. In practice, it seems to work very well.

Much of the functionality is copied exactly from HTTP2, including the naming of all the functions in client_h3.rs. This should make it easier to review and understand - simply compare to the HTTP2 equivalent.

The main difference is that H3 returns a driver which must be continuously polled to drive the connection until we are finished with it.

HTTP3 also doesn't support unencrypted connections or HTTP1 proxies, so there's a good amount of functionality in Oha we don't have to extend for this H3 implementation.

To test it, you can use the examples in h3 as a server. For example,

cargo run --example server  -- --dir ./examples --listen 127.0.0.1:4433

@gseddon gseddon force-pushed the only-h3-changes branch from 4acebd7 to e681ebe Compare June 2, 2025 17:11
@gseddon gseddon force-pushed the only-h3-changes branch from e681ebe to 70d5ff3 Compare June 2, 2025 17:16
Copy link
Owner

@hatoo hatoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to keep http3 stuff to client_h3.rs more. But we can do it later.
Thank you!

Cargo.toml Outdated
@@ -60,6 +67,13 @@ rustls-native-certs = { version = "0.8.0", optional = true }
tokio-rustls = { version = "0.26.0", optional = true }
rustls-pki-types = { version = "1.7.0", optional = true }

h3 = { version = "0.0.7", optional = true }
h3-quinn = { version = "0.0.9", optional = true }
quinn-proto = { version = "*", optional = true, features = ["aws-lc-rs"]}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we specify version?
Please add some comment if there are some reason.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed this, will fix!

@@ -21,12 +21,15 @@ This program is built on stable Rust, with both `make` and `cmake` prerequisites

You can optionally build oha against [native-tls](https://github.com/sfackler/rust-native-tls) instead of [rustls](https://github.com/rustls/rustls).

cargo install --no-default-features --features rustls oha
cargo install --no-default-features --features native-tls oha
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hatoo hatoo merged commit d5678e0 into hatoo:master Jun 4, 2025
18 checks passed
@hatoo
Copy link
Owner

hatoo commented Jun 4, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants