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.
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
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.
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)
- 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
- Copy .git/modules/jellyfin-web to Docker image so webpack can run git describe
- Add SSH agent forwarding (-A) to build_truenas.sh for git submodule cloning
Allows specifying --debug to build.py to build Debug builds of the
server, facilitating easier debugging. This is then called by default
for weekly builds.
The default is handled by the JELLYFIN_FFMPEG envvar anyways, and by
removing this, that envvar can then by used by containers to set the
path as required.