static-web-server/static-web-server
static-web-server/static-web-server has 2,398 GitHub stars and 139 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-06 21:53 UTC. Last push 2026-11-01.
A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡
What you can do
- Built with Rust, memory-safe, fast, and concurrent with low CPU and RAM overhead.
- Single ~4 MB static binary with zero runtime dependencies (Musl libc). Runs on any Linux distro or Docker container.
- Fast, asynchronous static file-serving built on Hyper and Tokio.
- On-the-fly compression (Gzip, Deflate, Brotli, Zstandard) for text-based files via Accept-Encoding.
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalStatic Web Server
A cross-platform, high-performance and asynchronous web server for static file-serving ⚡
Overview
[!NOTE] This is the upcoming v3, currently in development. For production use, see v2 (LTS).
Static Web Server (SWS) is a small, fast, production-ready web server for static file-serving that prioritizes simplicity and ease of use while delivering high performance and safety, powered by Rust. Built on Hyper and Tokio to deliver efficient and performant asynchronous I/O and HTTP/1-2 support with a low resource footprint.
SWS is available for a variety of platforms like Linux, macOS, Windows, FreeBSD, NetBSD, Android and Docker.
Features
- Built with Rust, memory-safe, fast, and concurrent with low CPU and RAM overhead.
- Single ~4 MB static binary with zero runtime dependencies (Musl libc). Runs on any Linux distro or Docker container.
- Fast, asynchronous static file-serving built on Hyper and Tokio.
- On-the-fly compression (Gzip, Deflate, Brotli, Zstandard) for text-based files via
Accept-Encoding. - Serving of pre-compressed files (
.br,.gz,.zst) directly from disk. - Markdown content negotiation to serve
.mdfiles to clients that accepttext/markdown. - Byte-range serving for large file delivery.
- Optional Cache-Control headers and ETag with sensible defaults per file type.
- HTTP/2 + TLS with automatic security headers.
- Graceful shutdown with configurable grace period.
- Structured JSON logging (
--log-format) and file-based log output (--log-file). - Configurable thread pool (worker and blocking threads).
- Optional directory listing with HTML and JSON output, plus
.tar.gzdownload. - CORS with preflight support.
- Basic HTTP authentication (BCrypt).
- Custom response headers per file via glob patterns.
- URL rewrites and redirects with placeholder replacement.
- Virtual hosting with per-host root directories.
- Fallback page for 404 errors (SPA support).
- Custom error pages.
- Built-in HTTP to HTTPS redirect.
- Health check endpoints
/livezand/readyz(GET/HEAD) for Kubernetes-style probes. - Prometheus metrics endpoint with request counts, latency histograms, and connection tracking.
- Maintenance mode with configurable status.
- Configuration via CLI arguments, environment variables, or a TOML file.
- Windows Service support.
- Socket activation (systemd) for sandboxed and on-demand deployments.
- Available as a Rust library with opt-in features.
- First-class Docker images: Scratch, Alpine Linux, and Debian.
- Cross-platform pre-compiled binaries for
Linux,macOS,Windows,FreeBSD,NetBSD,Android(x86_64,ARM64).
Documentation
Please refer to The Documentation Website for more details about the API, usage and examples.
Releases
Contributions
Unless you explicitly state otherwise, any contribution you intentionally submitted for inclusion in current work, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to submit a pull request or file an issue.
Community
License
This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
© 2019-present Jose Quintana
Explore related projects
freeCodeCamp/freeCodeCamp
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
458,713 starsdonnemartin/system-design-primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
377,237 starsreact/react
The library for web and native user interfaces.
252,361 starsvuejs/vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
212,631 stars