Skip to content

losfair/zeroserve

Repository files navigation

zeroserve

Zero-config, fast io_uring-based HTTPS server.

zeroserve serves a website packaged as a tarball, and handles hot-reload via SIGHUP.

Features

  • Built-in TLS support
  • All network and disk I/O use io_uring
  • Clean - does not leave any temporary files on disk. Tarballs are indexed during loading (path -> byte-range), and served via byte-range reads on the tarball directly.
  • Support for low-latency eBPF request processing middleware

Dependencies

  • monoio: the io_uring runtime
  • clap: Argument parser (use derive macro)
  • monoio-rustls: TLS server
  • tar: Tarball handling

Usage

# Serve HTTP on port 8080
zeroserve --addr 0.0.0.0:8080 site.tar

# Serve HTTP on port 8080, and HTTPS on port 8443
zeroserve --addr 0.0.0.0:8080 --tls-addr 0.0.0.0:8443 --cert certificate.pem --key key.pem site.tar

# Fall back to <path>.html when a request path is missing
zeroserve --addr 0.0.0.0:8080 --try-html site.tar

# Honor PROXY protocol v1 headers (e.g. when behind a TCP load balancer)
zeroserve --enable-proxy-protocol site.tar

# Hot-reload certificate and site tarball
killall -SIGHUP zeroserve

Testing

End-to-end tests live in testing/ and are written in TypeScript for Deno.

# Run all e2e tests
cd testing
deno test -A --parallel

The scripting tests require clang and llc to be available on PATH; they are skipped if the toolchain is missing.

About

Zero-config, fast `io_uring`-based HTTPS server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors