tubetti

Crates.iotubetti
lib.rstubetti
version0.3.1
created_at2025-02-15 01:29:34.258962+00
updated_at2025-05-18 20:04:48.16744+00
descriptionServe &[u8] data at a localhost url with minimal configuration
homepage
repositoryhttps://github.com/molenick/tubetti
max_upload_size
id1556179
size68,159
Matt (molenick)

documentation

README

Tubetti: small http tubes

No-fuss, low configuration webservers on demand

Features:

  • Convenience-focused development experience
  • Axum-based, can optionally be constructed from a Router
  • Supports ranged requests using axum-range
  • Supports custom headers using HeaderMap
  • Supports artifically slow response times with configurable delay

Example Usage

use tubetti::tube;

let body = std::sync::Arc::new("potatoes".as_bytes());
let tb = tube!(body).await.unwrap();
let client = reqwest::Client::new();
let response = client.get(tb.url()).send().await.unwrap();
assert_eq!(response.headers().get("accept-ranges").unwrap(), "bytes");
assert_eq!(response.headers().get("content-length").unwrap(), "8");
assert_eq!(response.bytes().await.unwrap(), "potatoes".as_bytes());
tb.shutdown().await.unwrap();

Please take a look at the examples for more detailed usage information.

License

MIT OR Apache-2.0

Commit count: 39

cargo fmt