mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-01 11:20:59 +03:00
When using a reverse proxy, different sessions cannot find each other, breaking remote control #255
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?
Originally created by @hawken93 on GitHub (Jan 10, 2019).
found this while looking at #496
Turns out I could not find any devices to remote control because I was using a reverse proxy, and somehow that breaks the functionality.
I think jellyfin must be looking at the originating ip, and somehow rely on that to identify sessions. Maybe a security measure. But it breaks this..
@sparky8251 commented on GitHub (Jan 10, 2019):
Poke at various proxy settings like transparent and such. One such setting out to exist that will fix your problem.
It seems unlikely to me that this is a problem with the server. I've found all manner of web apps break in odd ways if I don't set the reverse proxy perfectly.
@hawken93 commented on GitHub (Jan 10, 2019):
I can't make it transparent, that's not possible for my usecase. In my case I'm using apache in front of it
@sparky8251 commented on GitHub (Jan 10, 2019):
Well, not claiming transparent is the missing setting. Just that if any setting is, it might not be trivial to fix it in the actual code vs turning on the setting.
@hawken93 commented on GitHub (Jan 10, 2019):
Unless I'm mistaken, I think transparent proxying is something squid can do if it's inline with the traffic. But this is relying on telling iptables to redirect traffic that already has a source and destination ip set. In my case I'm using apache to split a public ip to different internal IPs based on SNI, and it also serves to convert http to https. Apache doesn't fake the external IP and that is also not how reverse proxying is done in general
I think Jellyfin should support being behind such a proxy, and in that case it would perhaps need a setting to trust a server to deliver http requests where the original ip is in an added http header..
@sparky8251 commented on GitHub (Jan 10, 2019):
Might be part of the stupid custom HTML server. Yet more reason to switch to Kestrel imo.
@hawken93 commented on GitHub (Jan 10, 2019):
The client wasn't setting SupportsRemoteControl, investigating the browser console lead me to this:
Turns out that we have to proxy websocket with GET parameters nowadays.
And that it's calledembywebsocketnow, notsocketEDIT: seems like it usessocketfor https andembywebsocketfor http or something. Lol. So you need both to stay safeEDIT: have taken a look at apiclient.js and found out that I'm seeing "/socket" because my server URL starts with "https://emby". For most users this will not be the case. This check is buggy and as far as I understand the intention from the developer has been to have the path of the websocket be /embywebsocket. But we get to decide.. :) Both need to be supported to avoid random breakage.
@hawken93 commented on GitHub (Jan 10, 2019):
Should be documented...