embystream 0.0.21

Another Emby streaming application (frontend/backend separation) written in Rust.
Documentation
[Log]
level = "info"
prefix = ""
root_path = "./logs"

[General]
memory_mode = "high"
stream_mode = "backend"
encipher_key = "Q4eCbawEp3sCvDvx"
encipher_iv = "a3cH2abhxnu9hGo5"

[Emby]
url = "http://127.0.0.1"
port = "8096"
token = "nmbp7mpixze8ghdfgki6yrijkeq5zuao"

[UserAgent]
mode = "deny"
allow_ua = []
deny_ua = ["curl", "wget", "python", "fimily", "infuse-library"]

[Http2]
ssl_cert_file = ""
ssl_key_file = ""

[Fallback]
video_missing_path = "/mnt/anime/fallback/video_missing.mp4"

[Frontend]
listen_port = 60001
check_file_existence = true

[[Frontend.PathRewrite]]
enable = false
pattern = "^(/.*)$"
replacement = "https://my-cdn.com$1"

[[Frontend.PathRewrite]]
enable = false
pattern = "^/media(/.*)$"
replacement = "$1"

[[Frontend.PathRewrite]]
enable = false
pattern = "^/stream(/.*)$"
replacement = "/proxy$1"

[Frontend.AntiReverseProxy]
enable = false
host = ""

[Backend]
listen_port = 60001
base_url = "https://backend.example.com"
port = "443"
path = "stream"
problematic_clients = ["yamby", "hills", "embytolocalplayer", "Emby/"]

[[BackendNode]]
name = "MyOpenList"
type = "OpenList"
pattern = "/openlist/.*"
base_url = "http://alist.example.com"
port = "5244"
path = "/openlist"
priority = 0
proxy_mode = "redirect"
client_speed_limit_kbs = 0
client_burst_speed_kbs = 0

[[BackendNode.PathRewrite]]
enable = false
pattern = "^/openlist(/.*)$"
replacement = "$1"

[BackendNode.AntiReverseProxy]
enable = false
host = ""

[BackendNode.OpenList]
base_url = "http://alist.example.com"
port = ""
token = "mock_token_12345"

[[BackendNode]]
name = "CloudDrive"
type = "DirectLink"
pattern = "/cloud/.*"
base_url = "https://cloud.example.com"
port = "443"
path = "/cloud"
priority = 0
proxy_mode = "redirect"
client_speed_limit_kbs = 0
client_burst_speed_kbs = 0

[[BackendNode.PathRewrite]]
enable = false
pattern = "^/cloud(/.*)$"
replacement = "https://cdn.example.com$1"

[BackendNode.AntiReverseProxy]
enable = false
host = ""

[BackendNode.DirectLink]
user_agent = "Mozilla/5.0 (MockClient)"

# StreamRelay: forward the signed GET to `base_url`+`port`+`path` with the same query string.
# - `pattern` as a regex on the decrypted file path (e.g. ^/mnt/GD(/.*)$) selects this node in
#   normal signed-stream handling (same as other backends).
# - Optional: first middleware can also match the HTTP path (e.g. ^/stream$) and 301 without
#   decrypting the sign on this host.
# - `proxy_mode`: `redirect` sends the client a Location; `proxy` GETs the remote stream URL
#   (same query string) and pipes the response through this host.
# - Invalid base_url (empty or loopback) is ignored: node is dropped with a startup WARN.
# Disk: local files only. Omit `base_url` or use empty/127.0.0.1/localhost for local paths;
# non-local base_url relay is not supported (use StreamRelay instead).
# [[BackendNode]]
# name = "RelayToOtherBackend"
# type = "StreamRelay"
# pattern = "^/mnt/stream-relay(/.*)$"
# priority = 0
# base_url = "https://other-backend.example.com"
# port = "443"
# path = "stream"
# proxy_mode = "redirect"
# client_speed_limit_kbs = 0
# client_burst_speed_kbs = 0

# WebDav: decrypted logical path is mapped to upstream HTTP(S). redirect does not send
# credentials; proxy may use HTTP Basic (cached). url_mode: path_join | query_path |
# url_template (default path_join when empty).
[[BackendNode]]
name = "RcloneWebDav"
type = "WebDav"
pattern = "/rclone/.*"
base_url = "http://127.0.0.1"
port = "60005"
path = ""
priority = 0
proxy_mode = "proxy"
client_speed_limit_kbs = 0
client_burst_speed_kbs = 0

[[BackendNode.PathRewrite]]
enable = false
pattern = "^/rclone(/.*)$"
replacement = "$1"

[BackendNode.AntiReverseProxy]
enable = false
host = ""

[BackendNode.WebDav]
url_mode = "path_join"
query_param = "path"
url_template = ""
username = ""
password = ""
user_agent = ""

# Example for url_template (set url_mode = "url_template" and fill url_template; fixed
# query params allowed):
# url_mode = "url_template"
# url_template = "http://127.0.0.1:60005/dav/item?path={file_path}&sort=desc"