ZMS provides a pure Zig solution to set up a mirror server for fetching Zig tarballs on demand and caching them on the local disk.
See rationale here.
Suppose X
is the base URL, X/${filename}
will fetch requested file.
zig build && ./zig-out/bin/zms --help
USAGE: ./zig-out/bin/zms [OPTIONS] OPTIONS: -h, --host STRING HTTP server bind host(default: 0.0.0.0) -p, --port INTEGER HTTP server bind port(default: 9090) -t, --threads INTEGER Number of threads to use for serving HTTP requests(default: 32) -d, --tarball_dir STRING Directory for storing zig tarballs(default: /tmp) -h, --help Show help