httpsd 0.1.0

A pure-Rust HTTP/HTTPS server — usable as a sans-I/O library with pluggable runtimes (thread pool, tokio, mio) or as a CLI that serves a directory or a TOML config.
Documentation
# Example httpsd configuration. Run with: httpsd -c samples/config.toml

# One address, or a list: listen = ["127.0.0.1:8080", "[::1]:8080"]
listen = "127.0.0.1:8080"

# Directory to serve static files from.
root = "./public"

# Optional: the value sent in the `Server` response header.
server_name = "httpsd"

# Optional: worker thread count (thread-pool runtime). Defaults to CPU count.
# workers = 8

# Uncomment to enable HTTPS with a real certificate:
# [tls]
# cert = "cert.pem"   # PEM chain, leaf first
# key  = "key.pem"    # PEM private key (PKCS#8, PKCS#1 RSA, or SEC1 EC)

# ...or generate an ephemeral self-signed cert for local development:
# [tls]
# self_signed = ["localhost"]

[compress]
enabled = true
min_size = 256

# Strict-Transport-Security, sent only on HTTPS responses.
# [hsts]
# max_age = 31536000
# include_subdomains = false
# preload = false

# Plain-HTTP listener: redirects to HTTPS and serves ACME HTTP-01 challenges.
# http_listen = "0.0.0.0:80"
# Serve content over HTTP instead of redirecting (off by default):
# allow_http = false

# Automatic certificates via ACME (e.g. Let's Encrypt). Requires accept_tos.
# [acme]
# accept_tos = true
# email = "you@example.com"
# staging = true                     # use Let's Encrypt staging while testing
# directory = "https://acme-v02.api.letsencrypt.org/directory"  # any ACME CA
# host_whitelist = ["example.com", "www.example.com"]
# cert_dir = "/var/lib/httpsd"