RTP/IPTV multicast-to-HTTP streaming daemon written in C, with a React/TypeScript web UI embedded into the binary.
- Pure C (C11) — do NOT introduce C++ code or features
- Multi-worker model via
fork()— workers are independent, only sharing stats via shared memory - Cross-platform: Linux, macOS, FreeBSD — use
#ifdeffor platform-specific APIs - Web UI (React/Vite) is compiled and embedded as
src/embedded_web_data.h— never edit this file directly - If
src/embedded_web_data.hchanges from a Web UI rebuild, do not commit it unless explicitly requested. - Config file format is INI (
rtp2httpd.conf), not YAML/JSON
- Indentation: 2 spaces, no tabs
- Structs:
_ssuffix for struct tag,_tfor typedef (struct connection_s→connection_t) - Header guards:
#ifndef __MODULE_H__/#define __MODULE_H__ - Logging: always use
logger()fromutils.h— neverprintf/fprintf - Strings: use
snprintf/strncpy— neversprintf/strcpy
- Formatter/linter: Biome (
biome.json), line width 120, indent with tabs - Follow
.nvmrcvianvm+ Corepack (pnpm) for JS tooling when available; ifnvmis unavailable, fall back to the systemnode. - Prefer Tailwind CSS utilities for styling; add custom CSS classes only when Tailwind cannot express the behavior clearly.
- Package manager: uv — do not use pip/pipenv/poetry
- Always run Python scripts via
uv run— do not usepythondirectly
- Chinese docs (
docs/) are the single source of truth - English docs (
docs/en/) are translations — always use thetranslate-docs-zh-enskill, do not translate directly - Built with VitePress:
pnpm run docs:build
- Commit messages and PR titles use Conventional Commits:
type(scope): subject
- Use Linux-only APIs without
#ifdefplatform guards - Use npm/yarn — this project uses pnpm
- Use autotools — this project uses CMake
- Add dependencies without discussing first
Toolchain is pre-installed and refreshed by the startup update script (pnpm install --frozen-lockfile
then uv sync --group dev). Standard commands live in package.json scripts and the build-run /
e2e skills — use those rather than reinventing them.
Non-obvious notes:
- Dev lab:
tools/devlab/devlab.pystarts local mock upstreams for Web UI/player debugging, including live, catchup, RTP multicast, HLS, and RTSP scenarios. Seetools/devlab/README.md.