8 Commits

Author SHA1 Message Date
mani
ad655ae4c4 Debug: Add test response for PlaybackInfo matching
Testing if path_regexp works by returning debug response
instead of proxying. This will show:
1. If the path is matched correctly
2. What User-Agent header is received

Once confirmed working, uncomment reverse_proxy lines.
2026-01-09 00:24:51 +01:00
mani
63f6738e11 Major fix: Caddy-based intelligent routing for Xbox filter
Complete architecture overhaul:
- Caddy is now the main proxy (port 8096)
- Only Xbox PlaybackInfo requests go to Python filter
- Everything else (WebSocket, streaming, API) goes directly to Jellyfin

Changes:
- Add Caddy service to docker-compose
- Use path_regexp for proper PlaybackInfo matching
- Remove method POST constraint (handled by path)
- Direct routing for non-Xbox requests
- WebSocket support for /socket endpoint

This fixes:
- 503 errors on normal requests
- 400 errors on WebSocket connections
- Performance issues from proxying everything

Architecture:
Client → Caddy → Check (path + User-Agent)
              ↓ Xbox PlaybackInfo → Python Filter → Jellyfin
              ↓ Everything else → Jellyfin
2026-01-09 00:21:57 +01:00
mani
0eaee053f5 Fix Caddyfile: Proper reverse proxy to Python filter
Caddyfile now:
- Runs on port 8097 (external)
- Proxies to xbox-filter:8096 (Python filter)
- Python filter handles all Xbox detection and codec filtering
- Python filter then proxies to jellyfin:8096 (internal)

Architecture:
Client :8097 → Caddy → :8096 Python Filter → :8096 Jellyfin

Use Caddy if you need additional features like:
- SSL/TLS termination
- Rate limiting
- Access control
- Advanced routing

Or use Python filter directly on port 8096 for simpler setup.
2026-01-09 00:19:14 +01:00
mani
a0097cae2d Revert "Clean up Xbox proxy: Remove obsolete Caddyfile and improve docs"
This reverts commit 9e6b9fc1db.
2026-01-09 00:18:43 +01:00
mani
9e6b9fc1db Clean up Xbox proxy: Remove obsolete Caddyfile and improve docs
- Remove Caddyfile (Python proxy handles everything)
- Clarify that REQUEST body is filtered, not response
- Add better log examples showing actual output
- Add docker-compose comments about port exposure
- Explain filtering flow: User-Agent detection → JSON parsing → Codec filtering
2026-01-09 00:17:47 +01:00
mani
c9ffefed70 Fix Xbox proxy: Filter REQUEST body instead of response
BREAKING FIX: DeviceProfile is sent FROM client TO server in request body,
not returned in response. This was the bug preventing the filter from working.

Changes:
- Filter DeviceProfile in POST request body before sending to Jellyfin
- Add extensive debug logging to track filtering process
- Remove unnecessary response filtering (DeviceProfile not in response)
- Simplify response handling (always stream)

Now logs:
- 'Xbox PlaybackInfo request detected' when Xbox client detected
- 'Filtering Xbox DeviceProfile in REQUEST' when filtering
- 'No DeviceProfile found' if profile missing (debug info)
2026-01-09 00:15:08 +01:00
mani
485b809a63 Fix Xbox proxy: Add proper header forwarding and streaming support
- Add query parameter forwarding (?api_key=... etc.)
- Add X-Forwarded-* headers for client IP tracking
- Exclude problematic headers (content-length, transfer-encoding, etc.)
- Add streaming support for large files (8KB chunks)
- Add root route handler
- Properly forward all HTTP methods
2026-01-09 00:12:50 +01:00
mani
1cedac1aa9 Add Xbox codec filter proxy as alternative to code patches
- Transparent reverse proxy that filters AV1/Opus for Xbox clients
- Detects Xbox via User-Agent header
- Docker-based solution, no Jellyfin code modifications needed
- Can be easily enabled/disabled without affecting Jellyfin updates
2026-01-09 00:03:04 +01:00