[PR #10415] Add function to fix cast with localhost server #12480

Open
opened 2026-02-07 06:56:38 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/10415

State: open
Merged: No


Adds a function to supply the webclient with a unique server LAN address after a localhost server API call. This enables the webclient to play to a chromecast receiver in such a case.

Changes

  • Determine unique local server address in Jellyfin.Networking/Manager/NetworkManager.cs
  • Pass this to the webclient with the GetPublicSystemInfo API call in Emby.Server.Implementations/ApplicationHost.cs

Explanation
This PR originates from the jellyfin-web issue with chromecast: https://github.com/jellyfin/jellyfin-web/issues/4745

While starting jellyfin-server it finds the bind addresses to listen to. And when starting jellyfin-web, it is able to find jellyfin-server alright. But when both jellyfin-server and jellyfin-web run on the same machine, they by default connect on url http://localhost:8096.

This works fine for the communication between jellyfin-web and jellyfin-server, but as a result this localhost url is also submitted to the cast receiver as url to connect to jellyfin-server. And for the cast receiver, localhost is not a valid address for jellyfin-server (in fact, with this address the cast receiver would try to find jellyfin-server internally ;-) )

So in this specific case of jellyfin-server and jellyfin-web communicating via localhost, the url to be passed to the cast receiver needs to be the 'real' LAN address of jellyfin-server.

As jellyfin-web is not able to establish this LAN address, jellyfin-server should deliver that via the API to jellyfin-client. So this issue requires changes in both jellyfin-server and jellyfin-web.

Issues
Fixes #10098

Remark
This is a resubmit of PR #10101 which was closed while the concerning src files were heavily changed and improved recently.

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/10415 **State:** open **Merged:** No --- Adds a function to supply the webclient with a unique server LAN address after a localhost server API call. This enables the webclient to play to a chromecast receiver in such a case. **Changes** - Determine unique local server address in Jellyfin.Networking/Manager/NetworkManager.cs - Pass this to the webclient with the GetPublicSystemInfo API call in Emby.Server.Implementations/ApplicationHost.cs **Explanation** This PR originates from the jellyfin-web issue with chromecast: https://github.com/jellyfin/jellyfin-web/issues/4745 While starting jellyfin-server it finds the bind addresses to listen to. And when starting jellyfin-web, it is able to find jellyfin-server alright. But when both jellyfin-server and jellyfin-web run on the same machine, they by default connect on url http://localhost:8096. This works fine for the communication between jellyfin-web and jellyfin-server, but as a result this localhost url is also submitted to the cast receiver as url to connect to jellyfin-server. And for the cast receiver, localhost is not a valid address for jellyfin-server (in fact, with this address the cast receiver would try to find jellyfin-server internally ;-) ) So in this specific case of jellyfin-server and jellyfin-web communicating via localhost, the url to be passed to the cast receiver needs to be the 'real' LAN address of jellyfin-server. As jellyfin-web is not able to establish this LAN address, jellyfin-server should deliver that via the API to jellyfin-client. So this issue requires changes in both jellyfin-server and jellyfin-web. **Issues** Fixes #10098 **Remark** This is a resubmit of PR #10101 which was closed while the concerning src files were heavily changed and improved recently.
OVERLORD added the pull-request label 2026-02-07 06:56:38 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12480