Skip to content

Custom Request Headers for Reverse Proxy Auth - #518

Open
404Simon wants to merge 1 commit into
andrewrabert:mainfrom
404Simon:custom-header-auth
Open

Custom Request Headers for Reverse Proxy Auth#518
404Simon wants to merge 1 commit into
andrewrabert:mainfrom
404Simon:custom-header-auth

Conversation

@404Simon

Copy link
Copy Markdown

Problem

Users behind reverse proxies that want to use header-based authentication cannot log in or stream media because the client doesnt allow adding these auth headers.
I use Pangolin and really like this feature as it gives me an extra layer of security.

Solution

Adds an expandable section to the server-address entry overlay where users can configure arbitrary HTTP header key/value pairs.

Three injection points

Injection point Scope
CefResourceRequestHandler::on_before_resource_load All CEF browser requests (API calls, jellyfin-web)
CefURLRequest in ServerProbeClient The server connectivity probe (HEAD + GET to /System/Info/Public)
mpv http-header-fields option Streaming requests made directly by mpv (HLS, direct play)

What changed

  • src/config/src/lib.rs: new custom_headers: Vec<(String, String)> persisted in settings.json
  • src/jfn_cef/src/client_impl/resource_request.rs: CefResourceRequestHandler that injects headers into browser requests matching the configured server URL
  • src/jfn_cef/src/client_impl/request.rs: CefRequestHandler that returns the resource handler per frame
  • src/jfn_cef/src/client_impl.rs: wired request_handler into wrap_client!
  • src/jfn_cef/src/injection.rs: added getCustomHeaders / setCustomHeaders native IPC functions
  • src/jfn_cef/src/business_overlay.rs: IPC handlers for header save/load; headers on connectivity probe requests
  • src/jfn_cef/src/business_web.rs: passes headers to mpv at playerLoad time
  • src/mpv/src/api.rs: sync mpv_set_property_string, sets http-header-fields on the mpv handle before loadfile
  • src/web/overlay.html: <details> element with header key/value rows
  • src/web/overlay.css: dark-theme styling matching existing form elements
  • src/web/overlay.js: dynamic header row builder, load/save via IPC
  • src/web/overlay.lang.js: English i18n strings for the advanced UI

Usage

  1. Open Jellyfin Desktop
  2. Enter server URL
  3. Click Advanced dropdown
  4. Click Add Header and enter key/value pairs
  5. Click Connect

Headers persist in settings.json across restarts.

@404Simon
404Simon force-pushed the custom-header-auth branch from 19edcb4 to 7843497 Compare June 20, 2026 14:13
Adds an 'Advanced' dropdown to the server-address overlay form
allowing users to configure custom HTTP headers (key/value pairs)
for reverse proxy authentication.
@404Simon
404Simon force-pushed the custom-header-auth branch from 7843497 to 7e155c8 Compare June 20, 2026 14:16
@andrewrabert andrewrabert added enhancement New feature or request mpv labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mpv

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants