| Crates.io | tonic-h3 |
| lib.rs | tonic-h3 |
| version | 0.0.4 |
| created_at | 2025-03-17 01:31:10.049529+00 |
| updated_at | 2025-07-15 05:17:04.242182+00 |
| description | gRPC over HTTP/3 for Rust |
| homepage | |
| repository | https://github.com/youyuanwu/tonic-h3 |
| max_upload_size | |
| id | 1594924 |
| size | 43,746 |
Experimental implementation of running tonic grpc on h3, following the proposal: G2-http3-protocol
tonic-h3 is targeted to support all quic transport implementations that integrates with h3. Currently the following are incoporated and tested:
See examples and tests for getting started.
Compatibility with grpc-dotnet with http3 is tested here.
tonic-h3 server.axum-h3 and tonic-h3.Server:
async fn run_server(endpoint: h3_quinn::quinn::Endpoint) -> Result<(), tonic_h3::Error> {
let router = tonic::transport::Server::builder()
.add_service(GreeterServer::new(HelloWorldService {}));
let acceptor = tonic_h3::quinn::H3QuinnAcceptor::new(endpoint.clone());
tonic_h3::server::H3Router::from(router)
.serve(acceptor)
.await?;
endpoint.wait_idle().await;
Ok(())
}
Client:
async fn run_client(
uri: http::Uri,
client_endpoint: h3_quinn::quinn::Endpoint,
) -> Result<(), tonic_h3::Error> {
let channel = tonic_h3::quinn::new_quinn_h3_channel(uri.clone(), client_endpoint.clone());
let mut client = crate::greeter_client::GreeterClient::new(channel);
let request = tonic::Request::new(crate::HelloRequest {
name: "Tonic".into(),
});
let response = client.say_hello(request).await?;
println!("RESPONSE={:?}", response);
Ok(())
}
MIT license. See LICENSE.