No description
  • Rust 95.4%
  • Dockerfile 4.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Klaus 272a6fb84f
All checks were successful
Build and publish container / check (push) Successful in 3s
Build using Cargo / build (push) Successful in 10m37s
Build and publish container / build (push) Successful in 13m34s
chore: rebrand to tube-proxy as part of SI-Tube
2026-11-29 10:18:37 -08:00
.forgejo/workflows chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
src chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
.dockerignore Add dockerfile. 2022-11-02 17:05:30 +00:00
.gitignore ci: migrate CI to Forgejo Actions; distroless container image build 2026-11-27 07:50:14 -08:00
Cargo.lock chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
Cargo.toml chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
Dockerfile chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
LICENSE Add license. 2022-11-02 16:56:29 +00:00
README.md chore: rebrand to tube-proxy as part of SI-Tube 2026-11-29 10:18:37 -08:00
renovate.json ci: migrate CI to Forgejo Actions; distroless container image build 2026-11-27 07:50:14 -08:00

tube-proxy

Part of the SI-Tube project: a proxy written in Rust, meant to superseed http3-ytproxy.

URL signing (qhash)

To keep random people from using the proxy as an open YouTube relay, every proxied request must carry a qhash capability tag: a truncated BLAKE3-256 MAC over the canonicalized request (sorted query pairs, then path, then the shared secret). Requests whose tag does not verify are rejected — since the secret is part of the hash, tags cannot be forged or adjusted to other hosts or parameters.

Key Meaning
HASH_SECRET Required. Shared secret for verifying the qhash tag; must be set to the same value as tube-backend's PROXY_HASH_SECRET. The proxy refuses to start without it.
ALLOW_INSECURE Set to true (or 1) to start without HASH_SECRET for local development, explicitly acknowledging an open proxy.

The tags are minted by tube-backend (see its PROXY_HASH_SECRET and docs/API.md, section "Protecting the proxy (signed URLs)"): clients use the proxy URLs exactly as returned by the API and never construct them themselves. URLs that the proxy regenerates inside DASH/HLS manifests are re-signed with the same secret.

The tags are replayable and do not expire on their own — a leaked URL only ever proxies that one specific upstream resource, and video playback URLs expire anyway through YouTube's own expire parameter, which the proxy enforces. Combined with tube-backend's DISABLE_UNAUTHENTICATED setting, signed proxy URLs are only ever handed out to authenticated users.

Credentials (e.g. a client's Authorization header) are always stripped from the request before it is forwarded to YouTube and other upstreams — they are never leaked to third parties.