| Crates.io | navar-iroh |
| lib.rs | navar-iroh |
| version | 0.1.0 |
| created_at | 2026-01-24 15:46:50.52165+00 |
| updated_at | 2026-01-24 15:46:50.52165+00 |
| description | Modular, transport-agnostic high-level HTTP client for Rust |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2066901 |
| size | 108,782 |
Navar is a modular, transport-agnostic HTTP client for Rust that separates the HTTP interface from the underlying network transport and runtime.
It allows you to run standard HTTP requests over TCP, TLS, or even P2P streams (like Iroh) without changing your application logic.
use navar::{Client, anyhow};
use navar_hyper::{HyperApp, Protocol};
use navar_tokio::{TokioRuntime, TokioTransport};
#[tokio::test]
async fn simple_fetch() -> anyhow::Result<()> {
let _ = rustls::crypto::ring::default_provider().install_default();
// 1. Create a client with your chosen Transport, App Protocol, and Runtime
let client = Client::new(
TokioTransport::default(), // Transport: TCP/TLS
HyperApp::new().with_protocol(Protocol::Auto), // App: Auto-negotiate H1/H2
TokioRuntime::default(), // Runtime: Tokio
);
// 2. Send requests normally
let res = client.get("https://example.org").send().await?;
println!("Status: {}", res.status());
Ok(())
}