π A blazingly fast, minimalist HTTP server built for modern Rust applications
VeTiS is a lightweight yet powerful web server that brings simplicity and performance together. Designed with Rust's safety guarantees in mind, it delivers HTTP/1, HTTP/2, and HTTP/3 support with a clean, intuitive API that makes building web services a breeze.
- π― Minimalist Design: Focus on what matters - serving HTTP requests efficiently
- π§ Flexible Runtime: Choose between Tokio or Smol async runtimes
- π Protocol Support: Full HTTP/1, HTTP/2, and HTTP/3 implementation
- π‘οΈ Secure by Default: Built-in TLS support with modern cryptography
- β‘ Zero-Cost Abstractions: Leverage Rust's performance without overhead
- π¦ Feature-Gated: Include only what you need for optimal binary size
Add VeTiS to your Cargo.toml:
vetis = { version = "0.1.0", features = ["tokio-rt", "http2", "tokio-rust-tls"] }- tokio-rt (default)
- smol-rt
- http1
- http2 (default)
- http3
- tokio-rust-tls (default)
Here's how simple it is to create a web server with VeTiS:
use bytes::Bytes;
use clap::Parser;
use http_body_util::Full;
use hyper::Response;
use vetis::{server::config::ServerConfig, Vetis};
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Args {
#[arg(
short = 'p',
long,
required = false,
num_args = 0..=1,
require_equals = true,
default_value = "8080",
help = "Port to listen on"
)]
port: u16,
#[arg(
short = 'i',
long,
required = false,
num_args = 0..=1,
require_equals = true,
default_value = "0.0.0.0",
help = "Interface to bind to"
)]
interface: String,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = Args::parse();
let config = ServerConfig::builder()
.port(args.port)
.interface(args.interface)
.build();
let mut server = Vetis::new(config);
server
.run(|_| async move {
Ok(Response::new(Full::new(Bytes::from("Hello from VeTiS! π"))))
})
.await?;
server.stop().await?;
Ok(())
}VeTiS is continuously evolving! Here's what we're working on:
- π Virtual Hosts - Host multiple domains on a single server
- π WebSockets - Real-time bidirectional communication
- π SNI Support - Server Name Indication for TLS
- π Reverse Proxy - Route requests to backend services
- βοΈ Load Balancing - Distribute traffic across multiple servers
- π Static File Serving - Efficient static asset delivery
- π Dynamic Content - Template rendering and content generation
- π Authentication - Multiple auth methods support
- π‘οΈ Authorization - Fine-grained access control
- π Logging - Comprehensive request and error logging
MIT
Rogerio Pereira Araujo rogerio.araujo@gmail.com