Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

AmakeSashaDev/maker_web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

maker_web

Security-first, high-performance, zero-allocation HTTP server for microservices

The development of this project has been discontinued. It was an interesting experience for me, but for many reasons the decision was made to discontinue development. Farewell 😞

Downloads Crates.io Documentation Build Status GitCode

English version πŸ‡ΊπŸ‡Έ | δΈ­ζ–‡η‰ˆ πŸ‡¨πŸ‡³

✨ Features

πŸ”’ Security & Protection

  • Built-in DoS/DDoS protection - enabled by default, with no performance penalty.
  • Fully configurable limits and timeouts for requests, responses, and connections.
  • Custom connection filtering - implement the ConnectionFilter trait to reject unwanted connections at the TCP level.

⚑ Performance & Memory

  • Zero-allocation - no memory allocations after server startup.
  • Pre-allocated memory for each connection - linear and transparent scaling.

🌐 Protocol & Management

  • Full HTTP stack - HTTP/1.1, HTTP/1.0, HTTP/0.9+ with keep-alive.
  • Automatic protocol detection for each request - keep-alive eliminates the need for manual protocol selection.
  • Storing data between requests - ability to store data between requests in a single connection using the [ConnectionData] trait.

🏭 Production Ready

  • Graceful performance degradation - automatic 503 responses when overloaded.
  • Custom error format - structured JSON (with codes/descriptions) or a plain HTTP response.
  • Resource protection - automatic closure of connections exceeding set limits.

🎯 Use Cases

  • High-throughput microservices - configurable for specific workloads
  • Resource-constrained environments - predictable memory usage
  • Internal APIs - security-conscious defaults
  • Performance-critical applications - zero-allocation design
  • Legacy system integration - HTTP/1.0 compatibility

🌐 Not just code

Everything that remains outside the documentationβ€”live statistics, deep details, and informal plansβ€”I collect on a separate website. This is a space that I strive to keep current and meaningful.

πŸš€ Quick Start

1. Installation

Add maker_web and tokio to your Cargo.toml:

cargo add maker_web tokio --features tokio/full

Or manually:

[dependencies]
maker_web = "0.1"
tokio = { version = "1", features = ["full"] }

2. Usage example

use maker_web::{Handled, Handler, Request, Response, Server, StatusCode};
use tokio::net::TcpListener;

struct MyHandler;

impl Handler for MyHandler {
    async fn handle(&self, _: &mut (), req: &Request, resp: &mut Response) -> Handled {
        match req.url().path_segments_str() {
            ["api", user, "name"] => {
                resp.status(StatusCode::Ok).body(user)
            }
            ["api", user, "name", "len"] => {
                resp.status(StatusCode::Ok).body(user.len())
            }
            ["api", "echo", text] => {
                resp.status(StatusCode::Ok).body(text)
            }
            _ => resp.status(StatusCode::NotFound).body("qwe"),
        }
    }
}

#[tokio::main]
async fn main() {
    Server::builder()
        .listener(TcpListener::bind("127.0.0.1:8080").await.unwrap())
        .handler(MyHandler)
        .build()
        .launch()
        .await;
}

πŸ“– Examples

Check the examples directory for comprehensive usage examples.

πŸ“Š Benchmarks

Performance comparisons are available in the benchmarks directory.

πŸ“„ License

maker_web is licensed under either of the following, at your option: