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

Open
opened 2025-12-22 09:13:52 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/10415
Author: @Sky-High
Created: 10/16/2023
Status: 🔄 Open

Base: masterHead: cast-with-localhost-server


📝 Commits (10+)

  • a208eb9 resolve conflicts
  • 6cf5ee3 Merge branch 'jellyfin:master' into cast-with-localhost-server
  • 241ed30 Merge branch 'jellyfin:master' into cast-with-localhost-server
  • 7a63017 Merge branch 'jellyfin:master' into cast-with-localhost-server
  • ce206d3 Merge branch 'jellyfin:master' into cast-with-localhost-server
  • 653c718 Update Jellyfin.Networking/Manager/NetworkManager.cs
  • 69e1961 resolve conflicts
  • 8b18ca3 Merge branch 'cast-with-localhost-server' of https://github.com/Sky-High/jellyfin into cast-with-localhost-server
  • 80ac989 Merge branch 'jellyfin:master' into cast-with-localhost-server
  • c83432f Merge branch 'jellyfin:master' into cast-with-localhost-server

📊 Changes

2 files changed (+91 additions, -1 deletions)

View changed files

📝 Emby.Server.Implementations/ApplicationHost.cs (+8 -1)
📝 src/Jellyfin.Networking/Manager/NetworkManager.cs (+83 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/10415 **Author:** [@Sky-High](https://github.com/Sky-High) **Created:** 10/16/2023 **Status:** 🔄 Open **Base:** `master` ← **Head:** `cast-with-localhost-server` --- ### 📝 Commits (10+) - [`a208eb9`](https://github.com/jellyfin/jellyfin/commit/a208eb983db6726f1cd9bdfcc9e68c98f0043169) resolve conflicts - [`6cf5ee3`](https://github.com/jellyfin/jellyfin/commit/6cf5ee36bc56ba282709faffe5cc31d9d39626ba) Merge branch 'jellyfin:master' into cast-with-localhost-server - [`241ed30`](https://github.com/jellyfin/jellyfin/commit/241ed30c0f0dbb5637a8e94803a557cab8c40afa) Merge branch 'jellyfin:master' into cast-with-localhost-server - [`7a63017`](https://github.com/jellyfin/jellyfin/commit/7a630178cb0fd6e93dce78322232ecd62517045f) Merge branch 'jellyfin:master' into cast-with-localhost-server - [`ce206d3`](https://github.com/jellyfin/jellyfin/commit/ce206d3f5deb9681e264ac051b6f96448de85137) Merge branch 'jellyfin:master' into cast-with-localhost-server - [`653c718`](https://github.com/jellyfin/jellyfin/commit/653c718c4439f622d1a3dea3e11997f2123ea809) Update Jellyfin.Networking/Manager/NetworkManager.cs - [`69e1961`](https://github.com/jellyfin/jellyfin/commit/69e1961107016caa32fe90e58661511a15742b6a) resolve conflicts - [`8b18ca3`](https://github.com/jellyfin/jellyfin/commit/8b18ca3656344f8f6cfab8f62397c61322deea81) Merge branch 'cast-with-localhost-server' of https://github.com/Sky-High/jellyfin into cast-with-localhost-server - [`80ac989`](https://github.com/jellyfin/jellyfin/commit/80ac989efec1f003c9906eaf79ea0648a8963b99) Merge branch 'jellyfin:master' into cast-with-localhost-server - [`c83432f`](https://github.com/jellyfin/jellyfin/commit/c83432f9e631eb4a0d38c06bd869eef014eaa521) Merge branch 'jellyfin:master' into cast-with-localhost-server ### 📊 Changes **2 files changed** (+91 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/ApplicationHost.cs` (+8 -1) 📝 `src/Jellyfin.Networking/Manager/NetworkManager.cs` (+83 -0) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo added the
pull-request
label 2025-12-22 09:13:52 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#12300
No description provided.