Skip to content
/ vetis Public

πŸš€ A blazingly fast, minimalist HTTP server built for modern Rust applications.

License

Notifications You must be signed in to change notification settings

ararog/vetis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VeTiS (Very Tiny Server)

πŸš€ 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.

✨ Why VeTiS?

  • 🎯 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

πŸ› οΈ Quick Start

Add VeTiS to your Cargo.toml:

vetis = { version = "0.1.0", features = ["tokio-rt", "http2", "tokio-rust-tls"] }

Runtimes

Crate features

  • tokio-rt (default)
  • smol-rt
  • http1
  • http2 (default)
  • http3
  • tokio-rust-tls (default)

πŸ’‘ Usage Example

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(())
}

πŸ—ΊοΈ Roadmap

VeTiS is continuously evolving! Here's what we're working on:

Core Features

  • 🌐 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

Content & Security

  • πŸ“ 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

πŸ“„ License

MIT

πŸ‘€ Author

Rogerio Pereira Araujo rogerio.araujo@gmail.com

About

πŸš€ A blazingly fast, minimalist HTTP server built for modern Rust applications.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •  

Languages