rws
Static file web server written in Rust. Serves HTTP/1.1 on a synchronous thread pool. Build with --features http2 to enable TLS and HTTP/2.
Install
This installs the rws binary with HTTP/2 and TLS support included.
Run
Plain HTTP/1.1
Starts on http://127.0.0.1:7878 by default. Place your files in the working directory and open the URL in a browser.
HTTPS + HTTP/2
Generate a self-signed certificate for local development:
Start the server with the certificate:
Open https://127.0.0.1:7878 in a browser. The server negotiates HTTP/2 or HTTP/1.1 automatically via ALPN on the same port.
For a public domain, obtain a certificate from Let's Encrypt.
Custom address and port
See CONFIGURE for all configuration options (env vars, config file, command-line flags).
Build from source
The binary is at target/release/rws.
To build without HTTP/2 and TLS (smaller binary, no system dependencies):
Features
- HTTP/2 with ALPN negotiation alongside HTTP/1.1 on the same port
- TLS via rustls (aws-lc-rs backend, no OpenSSL)
- CORS — allowed for all origins by default, fully configurable
- HTTP Range Requests — partial file serving and multi-range responses
- HTTP Client Hints
X-Content-Type-Options: nosniffandX-Frame-Optionsheaders- Symlink resolution
.htmlextension inference —/pageservespage.html;/dirservesdir/index.html- No caching headers — files are always served fresh
- Request/response logging to stdout
Further reading
- CONFIGURE — all configuration options
- FAQ — common problems and solutions
- DEVELOPER — building, testing, and contributing
- src/README.md — module-level documentation