Static Web Server
Static Web Server (SWS) is a lightweight, cross-platform Rust web server for serving static files with HTTP/2, TLS, compression, caching headers, and SPA fallbacks.
Static Web Server (SWS) is a small, production-ready web server designed for fast and efficient static file and asset hosting. Built in Rust on asynchronous networking foundations, it targets low resource usage while supporting modern HTTP features across many platforms.
Key Features
- High-performance asynchronous static file serving
- HTTP/1.1 and HTTP/2 support
- TLS support with optional HTTP to HTTPS redirect
- Optional on-demand and pre-compressed file serving (gzip, brotli, zstd, deflate)
- Byte-range requests (partial content) for large files
- SPA-friendly 404 fallback pages and custom error pages
- Directory listing (with sorting) and optional JSON output
- Configurable headers (including Cache-Control and security headers) and CORS support
- Basic HTTP authentication, URL rewrites/redirects, and virtual hosting
- Configuration via CLI, environment variables, or a TOML config file
Use Cases
- Hosting static websites, documentation, and front-end assets
- Serving single-page applications behind a lightweight web server
- Running a minimal file server in containers or on resource-constrained hosts
Limitations and Considerations
- Focused on static content; it is not intended to be a full dynamic application server
SWS is a strong fit when you need a simple, secure, and fast static server with modern protocol support and flexible runtime configuration. Its small footprint and broad platform support make it suitable for everything from local development to production deployments.
