9 Commits
Author SHA1 Message Date
germondai 01b911d2e8 docs(proxy): document residential proxy setup 2026-07-27 03:27:57 +02:00
germondai 3a4d7491b3 Merge pull request #37 from funkypenguin/fix/bound-restart-and-reclaim-stalled 2026-07-27 02:40:41 +02:00
germondai f397815fe7 fix(compose): pass upstream proxy configuration 2026-07-26 16:39:52 +02:00
germondai a60635ea07 docs(config): clarify environment variables 2026-07-26 11:37:24 +02:00
germondai f427ebb5b1 docs(env): document MITM_PROXY_HOST default + loopback override 2026-07-22 23:13:16 +02:00
germondai 3b3b643904 fix(proxy): bind listener to loopback by default with MITM_PROXY_HOST override 2026-07-22 19:50:30 +02:00
aziz66andClaude Fable 5 aa719dd1fa feat(proxy): browser-backed MITM forward-proxy mode
The FlareSolverr /v1 contract only returns cookies + user-agent. Clients like
Prowlarr take those and re-fetch the target with their own HTTP stack, which is
re-challenged on sites whose Cloudflare clearance is bound to the solving
browser's connection fingerprint (e.g. 1337x) — no cookie is portable to a
plain HTTP client, so those indexers can't be used at all.

Add an optional HTTP(S) forward proxy (MITM_PROXY_ENABLED). Point such a client's
proxy at it (per-indexer HTTP proxy in Prowlarr) and every request — search and
the .torrent/magnet grab — is transparently re-issued through the browser pool,
returning the RAW response bytes so binary downloads pass through intact.

- ca.ts: self-generated CA (persisted) + on-demand per-host leaf certs
- server.ts: per-host loopback-TLS termination (Bun's node:tls can't drive a
  handshake via emit("connection") or honor SNICallback, so one listening TLS
  server per host is the reliable path); raw-byte capture via page.goto response
  body, with the download-event path for binaries; scrape() fallback solves CF
- /proxy-ca.crt route to fetch the CA for the client's trust store
- New env: MITM_PROXY_{ENABLED,PORT,CA_DIR,MAX_TIER,DEBUG}

Off by default; localhost-only by design (a MITM proxy can impersonate any host
to a client that trusts its CA).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 01:13:45 +04:00
germondai 9261d5d92f docs: update references to renamed PORT env var 2026-07-05 18:06:12 +02:00
germondai a9409cb992 chore: add docker config and env template 2026-05-31 11:45:00 +02:00