Clean-room Rust rewrite of an Icecast2-compatible streaming server
  • Rust 73.9%
  • XSLT 13.1%
  • Shell 5.4%
  • Makefile 5.1%
  • Python 1.3%
  • Other 1.2%
Find a file
Quinn Ebert fd9b54614f Add ice-hk License; document two-license split (code vs. web UI)
The original ice-hk code (hk/, icesend/, iceplay/, test tooling) is now under the custom ice-hk License: permissive use with a perpetual, every-fork-level attribution requirement (verbatim notice in copies, derivatives, program banners, and footers). The admin/ and web/ web interface stays Karl Heyes' Icecast-KH work under GPL-2.0 (COPYING) until replaced by original work. README License section updated to describe the split.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:18:55 -04:00
admin Remove vendored C reference source; move admin/web templates to repo root 2026-05-21 21:51:14 -04:00
hk Park listeners on the fallback file when the source drops, return to live 2026-05-21 21:21:29 -04:00
iceplay Fix fallback-override: listener now observes mid-stream source changes 2026-05-14 10:00:18 -04:00
icesend Fix fallback-override: listener now observes mid-stream source changes 2026-05-14 10:00:18 -04:00
tests Remove vendored C reference source; move admin/web templates to repo root 2026-05-21 21:51:14 -04:00
web Remove vendored C reference source; move admin/web templates to repo root 2026-05-21 21:51:14 -04:00
.gitignore Remove vendored C reference source; move admin/web templates to repo root 2026-05-21 21:51:14 -04:00
build.sh Add build.sh: one-step build for Linux, FreeBSD, and macOS 2026-05-21 21:37:11 -04:00
COPYING Remove vendored C reference source; move admin/web templates to repo root 2026-05-21 21:51:14 -04:00
LICENSE Add ice-hk License; document two-license split (code vs. web UI) 2026-05-21 22:18:55 -04:00
README.md Add ice-hk License; document two-license split (code vs. web UI) 2026-05-21 22:18:55 -04:00

icecast-hk

Clean-room Rust rewrite of an Icecast2-compatible streaming server.

  • hk/ -- the Rust server (builds the icecast binary)
  • admin/ -- admin + status XSL templates (point adminroot here)
  • web/ -- static web assets (point webroot here)
  • icesend/, iceplay/ -- optional helper tools (build with ./build.sh --tools)

The hk build produces a binary named icecast that accepts the same config files, CLI flags, and XSL templates as upstream Icecast2.

Quick build

On Linux, FreeBSD, or macOS, the build.sh helper checks your toolchain and native dependencies, then builds the server in one step:

./build.sh              # release build -> hk/target/release/icecast
./build.sh --tools      # also build the icesend / iceplay helper tools
./build.sh --debug      # fast unoptimised build
./build.sh --static     # fully static musl build (Linux only)
./build.sh --help       # all options

It finds libxml2/libxslt through pkg-config (and on macOS adds Homebrew's keg-only pkgconfig directories automatically); if something is missing it prints the exact install command for your platform. The manual instructions below do the same thing by hand.

Windows is not supported. The server relies on Unix-only facilities (signal handling, privilege drop, chroot, daemonising). Build and run it under WSL2.

Build requirements

Builds on Linux, FreeBSD, and macOS (not Windows — see above).

  • Rust 1.75+ (stable)
  • pkg-config
  • libxml2 development headers
  • libxslt development headers

Build on Linux/amd64 (glibc)

Tested on Debian 12, Ubuntu 22.04+, Fedora 38+.

Debian / Ubuntu

sudo apt-get install build-essential pkg-config libxml2-dev libxslt1-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

cd hk
cargo build --release

Binary: target/release/icecast

Fedora / RHEL / Rocky

sudo dnf install gcc pkg-config libxml2-devel libxslt-devel
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

cd hk
cargo build --release

Arch

sudo pacman -S base-devel pkgconf libxml2 libxslt
cd hk
cargo build --release

Build on Linux/amd64 (musl) -- fully static binary

Useful for Alpine containers or single-binary deployment to any Linux box.

Alpine

apk add build-base pkgconf libxml2-dev libxslt-dev libxml2-static libxslt-static zlib-static xz-static
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

cd hk
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-musl

Binary: target/x86_64-unknown-linux-musl/release/icecast

Cross-compile musl from glibc host (Debian/Ubuntu)

sudo apt-get install build-essential pkg-config musl-tools libxml2-dev libxslt1-dev
rustup target add x86_64-unknown-linux-musl

cd hk
PKG_CONFIG_ALLOW_CROSS=1 \
  RUSTFLAGS='-C target-feature=+crt-static' \
  cargo build --release --target x86_64-unknown-linux-musl

Note: cross-compiling musl with dynamically-linked libxml2/libxslt from the host works but produces a binary that still dynamically links those two libraries. For a fully static binary, build natively on Alpine as shown above.

Build on FreeBSD

sudo pkg install rust pkgconf libxml2 libxslt
cd hk
cargo build --release

Build on macOS

Requires the Xcode command-line tools and Homebrew:

brew install rust pkg-config libxml2 libxslt
# libxml2/libxslt are keg-only, so point pkg-config at them:
export PKG_CONFIG_PATH="$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix libxslt)/lib/pkgconfig"
cd hk
cargo build --release

(./build.sh exports PKG_CONFIG_PATH for you, so on macOS you can just run that instead.)

Install

sudo cp target/release/icecast /usr/bin/icecast

The binary is a drop-in replacement -- point it at your existing icecast.xml and admin/web directories:

icecast -c /etc/icecast.xml

CLI

icecast -c <config>    Start with config file
icecast -b             Background (daemonize)
icecast -v             Print version
icecast -V             Verbose version

Runtime dependencies

The binary links dynamically against libxml2 and libxslt at runtime (unless built static on Alpine). These are the same libraries upstream Icecast requires, so an existing Icecast deployment already has them.

License

This repository is under two licenses:

  • ice-hk code (hk/, icesend/, iceplay/, and the test tooling) — the ice-hk License: use it however you like, subject to a perpetual attribution requirement. The required notice must be reproduced in copies and in derivatives at any fork depth, including program banners and UI/documentation footers.
  • Web interface (admin/, web/) — Karl Heyes' Icecast-KH UI, licensed GPL-2.0 (see COPYING), until it is replaced by original work.