Jump to content
dcrdev

Chromecast Address

Recommended Posts

dcrdev

Not sure of the correct place to post this, so I'll post it here.

 

Long story short:

  • Bought a couple of Chromecasts
  • Connected them to the network
  • Expected to be able to cast to them from Emby via the web app
  • Emby logo shows up on Chromecast display - nothing happens
  • Worth noting here that Emby is behind a reverse proxy, direct access to Emby over the network is blocked via firewall.
  • Try allowing direct access to Emby in the firewall.
  • It works - to confirm, this is still via the proxied web app.
  • Conclusion: Emby is sending the local address / port combination to the Chromecast as the source; instead of the proxied address - which I would have expected having correctly set the XFF header at my end.

Is there any way around this?

Edited by dcrdev
  • Like 1

Share this post


Link to post
Share on other sites
Luke

The logic is:

  • If the app detects you're currently outside of your home network, then it will use the address displayed as the remote address on your emby server dashboard
  • If the app detects it is inside the home network, then Chromecast will use whatever address the app is connecting to the server with, unless this happens to be a computer name, in which case Chromecast can't resolve that and therefore we'll use the local address displayed on your emby server dashboard.

Does that help?

Share this post


Link to post
Share on other sites
dcrdev

It does help my understanding yes, so thanks!

 

But by that logic:

  • I'm connecting to the web app using the external address displayed on the dashboard; for clarity I'm accessing the external address on the internal network.
  • That address is a FQDN, which has a DNS entry on my internal DNS server (dnsmasq) which resolves to my server's internal ip address. Obviously when accessed from outside the network, it resolves to my public IP address instead.
  • All clients using DHCP are automatically routed through that internal DNS server - including the Chromecast.

So shouldn't as per your point #2 - Emby be sending the external address as the source?

Share this post


Link to post
Share on other sites
Luke

No because the server is seeing the incoming ip address of your device as being on your local network. Why would the internal network address fail anyway?

Share this post


Link to post
Share on other sites
dcrdev

No because the server is seeing the incoming ip address of your device as being on your local network. Why would the internal network address fail anyway?

 

Becuase Emby is running on 8096, but I only allow inbound traffic on 80/443 - that's where the proxy comes in.

 

All inbound traffic not on 80/443 is blocked (purposefully) by the firewall.

 

Is there any way to force Emby to use the External address at all times?

Share this post


Link to post
Share on other sites
dcrdev

I take that as a no then...

Share this post


Link to post
Share on other sites
Luke

Currently the only way would be to make sure that you're not actually on the local network. I do think this is an area where we can improve though and look at supporting, e.g., the local DNS scenario where the connected emby server address will always be the same and just rely on the dns to figure out the address.

  • Like 1

Share this post


Link to post
Share on other sites
dcrdev

Cool, thanks for clearing up!

Share this post


Link to post
Share on other sites
Stampy

I am in the same boat as dcrdev. Basically the same setup with everything working fine apart from Chromecasts on the internal network. After a bit of reading, it looks like a few folk are having the same problem running a reverse proxy.

Is there any ETA on when this might be looked at. 

Share this post


Link to post
Share on other sites
benze

I'm a bit confused. How does the app determine if it is on the local network? What criteria does it use? Does it try to match the device (ex phone) ip address against the LAN networks configured in the settings?

 

If the app is using a fqdn to connect to the server, why does it still send the internal IP to the Chromecast instead of the fdqn? Can't the Chromecast resolve fqdn?

 

Is there any way to override the local IP that emby sees/uses?

 

Thanks

 

Eric

Share this post


Link to post
Share on other sites
Luke

Does the emby server dashboard display correct values for your local and remote addresses?

Share this post


Link to post
Share on other sites
vinw

I have the same problem I think (sorry to hijack this post). My Emby is running in a docker, with Traefik in front of it to do reverse proxy. The local address specified in my Emby Server Dashboard is the docker address (172.x.x.x, my internal lan at home is 192.x.x.x). I access the Emby Server using the full domain name, and my external IP adres (83.x.x.x). When I start the chromecast, the Emby logo will appear but when I start a stream it hangs on the loading icon. How would you go about getting functioning chromecast?

Share this post


Link to post
Share on other sites
Luke

Does the emby server dashboard display the correct remote address?

Share this post


Link to post
Share on other sites
benze

Does the emby server dashboard display correct values for your local and remote addresses?

Yes... It technically displays the correct address. The remote IP (ie public IP) and local ip (Docker IP) are accurate.

 

However, the docker IP displayed is the private docker IP that is inaccessible anywhere outside the docker container. I would need it to display the docker engine ip, which it does not.

 

I was hoping that since I was connecting via fqdn which reduces to my docker engine ip that the Chromecast would use the fqdn and not the displayed ip to try to connect.

 

 

Thanks,

 

Eric

Edited by benze

Share this post


Link to post
Share on other sites
Luke

Try configuring your external address in emby server advanced settings and see if that helps. Thanks.

Share this post


Link to post
Share on other sites
benze

Try configuring your external address in emby server advanced settings and see if that helps. Thanks.

 

Might be a silly question, but under what setting?  The only options I see in advanced settings are:

  • Remote IP Filter
  • Public http/https port number
  • external domain

 

I added it to external domain and it works better.  I can now cast from my phone.  But strangely enough, I cannot cast from my laptop on the same wifi network as my phone.  When I try to cast from my laptop (Macbook OsX running Chrome), it fails to launch the video.  I get the "Ready to cast" in the Emby chromecast app, but no video appears when I select it in Emby.  Just to test, I tried casting something else from a different tab on Chrome in my laptop and that worked.  It appears as though Chrome on the laptop is still sending the internal 172.x docker IP to Chromecast.

 

Additionally, I had a lot of difficulty setting the public http port number to 80.  Everytime I set it to 80  and clicked save, it changed to some other random port number.  First time was set to 50.  Then 56.  Then 44.  Eventually, after enough times of changing it to 80 and clicking save, it finally took and saved to 80.  Is that a bug?

 

 

Thanks,

Eric

Edited by benze

Share this post


Link to post
Share on other sites
Luke

No, it's not a bug. If it fails to get authorization on your system for port 80 then it will revert back to default. Port 80 can be tricky and you may have to run sudo to do that, or some other configuration within the OS.

Share this post


Link to post
Share on other sites
benze

No, it's not a bug. If it fails to get authorization on your system for port 80 then it will revert back to default. Port 80 can be tricky and you may have to run sudo to do that, or some other configuration within the OS.

Makes sense, but wasn't looking at it as the port I wanted emby to bind to, but rather just what I wanted the app to report to Chromecast (since I'm using a reverse proxy in front).

 

Any thoughts on why the web app is sending the internal IP to Chromecast instead of the fdqn? Both the phone and the laptop are on the same lan segment (192.168.1.x), yet the Android app is sending the remote fqdn instead.

 

Thanks

 

Eric

Share this post


Link to post
Share on other sites
vinw

I have the same problem I think (sorry to hijack this post). My Emby is running in a docker, with Traefik in front of it to do reverse proxy. The local address specified in my Emby Server Dashboard is the docker address (172.x.x.x, my internal lan at home is 192.x.x.x). I access the Emby Server using the full domain name, and my external IP adres (83.x.x.x). When I start the chromecast, the Emby logo will appear but when I start a stream it hangs on the loading icon. How would you go about getting functioning chromecast?

 

 

Does the emby server dashboard display the correct remote address?

 

I was a bit daft, the external access rule was set to whitelist without my address whitelisted. When I changed this to blacklist it worked.

 

For reference (other googlers coming here), what solved this was removing my external address in the configuration of the server, and just have a direct port connection from my router to the docker and as such bypassing Traefik. It's still also behind Traefik and can be used with the friendly hostname but as I understand from Luke, this way the Chromecast will use the raw ip+port.

Edited by vinw

Share this post


Link to post
Share on other sites
andrewmiskell

Try configuring your external address in emby server advanced settings and see if that helps. Thanks.

 

 

I'm having the same problem as the others but not with Chromecast, just the emby app itself.

 

Running emby in a docker container and the In-Home (LAN) access section shows the internal docker IP address. I'm using the Remote (WAN) access settings to make sure that emby is advertising the proper external hostname for the instance via Traefik reverse proxy.

 

I think a somewhat quick and easy way to workaround this would be to expose an advanced setting to manually override the In-Home (LAN) access hostname with a pre-specified IP address or hostname (similar to Plex's AVERTISE_IP environment variable for their docker container).

 

At the moment, this is the only thing holding me back from fully adopting Emby and migrating away from Plex. I love the ability to locally manage users and the better transcoding over Plex. Just need to it to play my content locally properly while still maintaining the reverse proxy configurations for external access.

Share this post


Link to post
Share on other sites
Luke

Have you tried setting the local network address in advanced settings?

Share this post


Link to post
Share on other sites
andrewmiskell

Have you tried setting the local network address in advanced settings?

 

 

Hi Luke, I responded to you on the GitHub issue I created for this. I'll keep communication there as to not pollute the thread. :D

Share this post


Link to post
Share on other sites
bkloppenborg

As with the others who posted here, I have Emby 3.5.3.0 running behind a traefik reverse proxy and am attempting to get my Chromecast to work. I have forwarding headers enabled in traefik, so the Emby logs are populated with either real IPs when a host connects from the Internet, or the LAN address of my router (192.168.1.1) when a host from my LAN connects (due to hairpin NAT). I am also using traefik's auto-TLS certificate capability through LetsEncrypt, but that probably isn't pertinent to this situation.

 

What I have noticed is that the Chromecast only streams videos when I access Emby via. my web browser using the WAN IP, but not when I access Emby via. a browser pointing to the domain. This is not the behavior I would expect given Luke's comment above:

 

The logic is:

  • If the app detects you're currently outside of your home network, then it will use the address displayed as the remote address on your emby server dashboard
  • If the app detects it is inside the home network, then Chromecast will use whatever address the app is connecting to the server with, unless this happens to be a computer name, in which case Chromecast can't resolve that and therefore we'll use the local address displayed on your emby server dashboard.

Does that help?

 

 

Given the above, I would expect that Emby would detect my computer is NOT in Emby's LAN and Emby would supply Emby's WAN IP to the Chromecast for streaming. However, this doesn't appear to be the case. Any thoughts on what could be happening and/or how it could be debugged?

 

For reference:

  • Emby LAN address: http://172.18.0.4:8096 as reported in the dashboard. This is correct (docker internal network)
  • Emby WAN address: http://XXX.YYY.247.82:8096 as reported in the dashboard. This is correct.
  • Emby service address: https://emby.domain.com. Works fine in the browser.
  • True LAN: 192.168.1.1/24 with router at 192.168.1.1
  • Media center PC at 192.168.1.10
  • Router has port forwarding for WAN:8096 to 192.168.1.10:8096 with hairpin/reflection NAT enabled. Works fine in the browser from both WAN and LAN.
  • Emby logs show all (true) LAN traffic originating from 192.168.1.1 due to hairpin NAT as would be expected.
Edited by bkloppenborg

Share this post


Link to post
Share on other sites
bkloppenborg

Last night I experimented a little more with my Emby <-> Chromecast issues. I also drew up a few diagrams to help illustrate my network configuration. Suffice it to say, the plot thickens.

 

I've tried to be fairly verbose in my reply in hopes that it clarifies some questions.

 

First a diagram of how my network is configured:

 

5c30dba84a3bd_embynetwork.png

 

Next an activity diagram of how a browser within my LAN communicates with Emby within a docker behind the traefik proxy. Notice that the traefik docker decrypts the HTTPS connection and forwards a HTTP connection to the emby-docker container. I've configured the proxy to send HTTP forward headers. The diagram should help clarify some of the network toplogy and TLS encryption/decryption questions that might be asked.

 

5c30d737a8ac7_embyactordiagram.png

 

 

The Emby Dashboard correctly reports the (docker) LAN address (http://172.18.0.4:8096) and global WAN address (http://73.x.y.z:8096). Aside from selecting the "Allow remote connections to this Emby server" for testing purposes, I haven't changed any of the IP, port, external domain, or secure connection options from their default values.

 

I've tried out four different methods for connecting to Emby from my browser and streaming a video to my Chromecast with the following results:

  1. https://emby.k.net:443 -> Browser works fine. Chromecast starts Emby app, but won't play. Emby logs the router LAN IP (192.168.1.1) and says it is responding to http://emby.k.net:8096/... for the browser's queries, but doesn't show the Chromecast attempting to connect.
  2. http://emby.k.net:8096 -> Browser works fine. Chromecast starts Emby app, but won't play. Emby logs the client's LAN IP (192.168.1.x) and says it is responding to http://emby.k.net:8096/... for the browser's queries, but doesn't show the Chromecast attempting to connect.
  3. http://73.x.y.z:8096 -> Browser AND Chromecast work. Emby logs the router LAN IP (192.168.1.1) and says it is responding to http://73.x.y.z:8096/... queries.
  4. http://192.168.1.10:8096 -> Browser AND Chromecast work. Emby logs the client's LAN IP (192.168.1.x) and says it is responding to http://192.168.1.10:8096/... queries.

So the only time the Chromecast works is when I access Emby using IPs instead of names.

 

From Luke's comments above, I would expect the https://emby.k.net:443 and http://emby.k.net:8096 options to provide the Chromecast with the http://73.x.y.z:8096 address, but this doesn't appear to be the case.

 

I'd be happy to debug further or try anything else.

  • Like 1

Share this post


Link to post
Share on other sites
benze

@@bkloppenborg I had similar issues, and I ended up adding redirection rules to the router to ensure that all DNS queries from the Chromecast were resolved by the router and not via the public DNS servers (my emby fqdn is not a public record).

 

From what I read about Chromecast their DNS servers were hard-coded to be 8.8.8.8 and 4.4.4.4 and do not resolve from DHCP DNS servers.

 

I still find it frustrating however; I would prefer there to be an option within emby to handle cases where it is hidden behind a separate network/router.

 

Thanks,

 

Eric

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...