rivulet-engine

module
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT

README

Rivulet Engine

A fast, IPv6-capable, pure-Go streaming server for Rivulet and other Stremio-compatible clients.

Torrents, archives, Usenet and FTP in; HLS, DLNA and plain Range streams out — one static binary, no runtime dependencies besides optional ffmpeg.

CI Latest release Go


Rivulet Engine is an open-source drop-in replacement for Stremio's closed-source streaming server (server.js), built on anacrolix/torrent. It serves the exact enginefs HTTP API that stremio-web and the Rivulet Kodi addon expect, so you point a client at it and it just works.

Not affiliated with or endorsed by Stremio.

Contents

Features

  • Dual-stack torrent engine — IPv4 + IPv6, TCP + uTP, DHT, PEX, WebTorrent and webseeds, with RTT-ranked public trackers.
  • Full enginefs API — create/stats/remove, Range streaming with DLNA headers, subtitles (SRT/VTT/ASS → WebVTT), OpenSubtitles hashing, probing.
  • HLS transcoding — on-demand ffmpeg with VAAPI, NVENC, QSV, VideoToolbox and V4L2M2M acceleration (libx264 fallback), multi-audio and embedded-subtitle renditions, HDR → SDR tone mapping.
  • More than torrents — stream from ZIP/RAR/7z/TAR archives, Usenet (NZB), FTP/FTPS and YouTube, all pure Go.
  • Stream proxy — HLS/DASH rewriting, signed URLs, MediaFlow/EasyProxy compatible, with declarative extractors.
  • DLNA casting and an opt-in DVR for live streams.
  • Bounded resources — LRU disk cache, optional RAM-only mode, idle torrent reclaim, Prometheus /metrics.
  • Self-hosted indexers — Bitmagnet and Torznab add-ons built in.

The full list, with routes and behaviours, is in docs/FEATURES.md.

Install

Prebuilt binaries for Linux, macOS, Windows and Android (arm64 / armv7 / x86_64 / x86) are attached to each release. The Rivulet addon downloads and runs the right one for you.

Method Command
Go (1.27+, no CGO) go install github.com/rivulet-kodi/rivulet-engine/cmd/rivulet-engine@latest
From source make build → ./rivulet-engine (make build-all cross-compiles every target)
Container Podman/Docker or a HuggingFace Space — see docs/CONTAINER.md

Run

./rivulet-engine            # http://127.0.0.1:11470  (https on :12470)
./rivulet-engine version

Then set your client's streaming server URL to http://127.0.0.1:11470. For a Stremio web UI over HTTPS, see docs/HTTPS.md.

Configuration

Everything is an environment variable. Unprefixed names are the server.js-compatible ones; the rest use the RIVULET_ prefix. The most common ones:

Variable Default Purpose
BIND_ADDRESS all interfaces Interface to listen on. Set 127.0.0.1 unless you need LAN access.
HTTP_PORT / HTTPS_PORT 11470 / 12470 Listener ports (HTTPS_PORT=0 disables HTTPS).
APP_PATH ~/.rivulet-engine Data and cache root.
RIVULET_PUBLIC_URL derived External base URL, for use behind a reverse proxy.
RIVULET_ALLOWED_ORIGINS built-in list Extra browser Origins allowed to call the API.
RIVULET_CACHE_ROOT $APP_PATH Disk piece-cache directory (e.g. tmpfs or a USB drive instead of an SD card).
RIVULET_MEMORY_CACHE_SIZE 0 (disk) RAM-only piece cache in bytes, for low-disk devices.
RIVULET_TORRENT_IDLE_TIMEOUT 300 Seconds before an unused torrent is dropped.
RIVULET_HWACCEL auto 0 forces software transcode, or pin vaapi, nvenc, …
RIVULET_ENABLE_DLNA off Enable casting on /casting.
RIVULET_LOG_LEVEL info debug / info / warn / error.

The full list, about 100 knobs, is in docs/CONFIGURATION.md. A ready-made systemd user unit and env file live in deploy/systemd.

Documentation

Guide Covers
Features Full feature and route reference
Configuration Every environment variable
HLS transcoding Per-session overrides, persistent sessions, tone mapping
BitTorrent tuning Censorship resistance, start-up priming, speed limits
Stream proxy /proxy rewriting, DRM, signed URLs
Extractors Declarative host definitions for /extractor
DVR Recording live streams
HTTPS Browser-trusted certificate for the Stremio web UI
Container Podman, Docker, HuggingFace Spaces
Bitmagnet · Torznab Indexer add-ons
Platforms Build targets, Android, library mode
Architecture Package layout
API reference OpenAPI 3.1 spec (also GET /openapi.json; interactive page at /api/reference)

Security

Rivulet Engine is a localhost service with no authentication: anything that can reach the port is trusted. The default binds every interface, so set BIND_ADDRESS=127.0.0.1 and never expose :11470 / :12470 to untrusted networks. State-changing routes and /proxy additionally check the browser Origin, and every outbound fetch goes through an SSRF guard. Details in docs/SECURITY.md.

Development

make build      # host binary
make test       # go test -p 1 -race ./...
make lint       # golangci-lint
make api-fuzz   # fuzz the HTTP API against the OpenAPI spec (docker/podman)
make smoke      # end-to-end API test against a running build

See AGENTS.md for conventions and docs/ARCHITECTURE.md for the package layout.

License

MIT — Copyright (c) 2026 The rivulet-engine Authors. Contributions are accepted under the same license; new files carry the project's SPDX header (reuse annotate --copyright 'The rivulet-engine Authors' --license MIT <file>), and first-time contributors add themselves to AUTHORS.

Directories

Path Synopsis
cmd
librivulet-engine command
Command librivulet-engine builds librivulet-engine.so, a c-shared version of rivulet-engine for SELinux-enforcing Android hosts where the shell's exec() of a bundled executable is blocked by policy but dlopen() of a shared library dropped next to the calling app's own native libs is not.
Command librivulet-engine builds librivulet-engine.so, a c-shared version of rivulet-engine for SELinux-enforcing Android hosts where the shell's exec() of a bundled executable is blocked by policy but dlopen() of a shared library dropped next to the calling app's own native libs is not.
rivulet-engine command
Command rivulet-engine is a lightweight, IPv6-capable drop-in replacement for Stremio's closed-source streaming server (server.js), built on anacrolix/torrent.
Command rivulet-engine is a lightweight, IPv6-capable drop-in replacement for Stremio's closed-source streaming server (server.js), built on anacrolix/torrent.
internal
api
Package api implements the enginefs-compatible HTTP surface that stremio-web expects from a Stremio streaming server.
Package api implements the enginefs-compatible HTTP surface that stremio-web expects from a Stremio streaming server.
app
Package app hosts the reusable server bootstrap (env parsing, subsystem wiring, HTTP/HTTPS listeners, graceful shutdown) shared by the cmd/rivulet-engine executable and the cmd/librivulet-engine c-shared library.
Package app hosts the reusable server bootstrap (env parsing, subsystem wiring, HTTP/HTTPS listeners, graceful shutdown) shared by the cmd/rivulet-engine executable and the cmd/librivulet-engine c-shared library.
archive
Package archive provides a uniform streaming reader over local archive files (zip, tar, tgz, rar, 7zip).
Package archive provides a uniform streaming reader over local archive files (zip, tar, tgz, rar, 7zip).
dvr
Package dvr records live streams to disk with ffmpeg (stream copy, MPEG-TS), mirroring the DVR of EasyProxy (github.com/realbestia1/EasyProxy, services/recording_manager.py): a recording is started in the background, listed with the JSON shape DVR addons consume, can be stopped (gracefully, so the file stays playable), watched while it grows, and deleted.
Package dvr records live streams to disk with ffmpeg (stream copy, MPEG-TS), mirroring the DVR of EasyProxy (github.com/realbestia1/EasyProxy, services/recording_manager.py): a recording is started in the background, listed with the JSON shape DVR addons consume, can be stopped (gracefully, so the file stays playable), watched while it grows, and deleted.
earlyenv
Package earlyenv adjusts process environment that third-party packages read in their own init() functions, before those init() functions run.
Package earlyenv adjusts process environment that third-party packages read in their own init() functions, before those init() functions run.
engine
Package engine wraps anacrolix/torrent to provide the EngineManager and Engine interfaces declared in internal/types.
Package engine wraps anacrolix/torrent to provide the EngineManager and Engine interfaces declared in internal/types.
ftpstream
Package ftpstream provides a unified Open function for streaming files from FTP/FTPS servers and HTTP/HTTPS URLs.
Package ftpstream provides a unified Open function for streaming files from FTP/FTPS servers and HTTP/HTTPS URLs.
logging
Package logging provides the application's structured logger, built on the standard library's log/slog.
Package logging provides the application's structured logger, built on the standard library's log/slog.
media
Package media implements types.MediaProber, backing the ffprobe/ffmpeg helper routes.
Package media implements types.MediaProber, backing the ffprobe/ffmpeg helper routes.
netguard
Package netguard provides SSRF protection primitives shared across the outbound-fetch paths (proxy, /create blob, ftpstream HTTP).
Package netguard provides SSRF protection primitives shared across the outbound-fetch paths (proxy, /create blob, ftpstream HTTP).
nzb
Package nzb provides NZB XML parsing, yEnc decoding, and an NNTP client for assembling Usenet files from their individual article segments.
Package nzb provides NZB XML parsing, yEnc decoding, and an NNTP client for assembling Usenet files from their individual article segments.
settings
Package settings implements types.SettingsStore: it holds the user-facing server settings, persists them to <appPath>/server-settings.json, and exposes the GUI schema expected by stremio-web's settings panel.
Package settings implements types.SettingsStore: it holds the user-facing server settings, persists them to <appPath>/server-settings.json, and exposes the GUI schema expected by stremio-web's settings panel.
streamproxy
Package streamproxy implements an HTTP stream proxy with HLS/DASH manifest rewriting, optional segment decryption, signed URLs, and caching.
Package streamproxy implements an HTTP stream proxy with HLS/DASH manifest rewriting, optional segment decryption, signed URLs, and caching.
types
Package types holds the shared contract between the engine, api, settings and media packages.
Package types holds the shared contract between the engine, api, settings and media packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL