mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #10415] Add function to fix cast with localhost server #12480
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.