Jump to content

Cloudflare tunnel & emby connect


Go to solution Solved by markpeo,

Recommended Posts

Posted (edited)

Hi,

I have read through lots of posts here, on reddit & unraid forums but just cannot find a way to resolve my issue.

In a nutshell, I have a cloudflare tunnel that points to my emby server. (unraid server, official Emby docker, and Unraid-Cloudefared-Tunnel docker.) 

Using https://subdomain.mydomain.com (the same remote address url that is displayed on my server dashboard) in a web browser from anywhere outside of my LAN network, on any device, works perfectly. 

I cannot login using the android app or via app.emby.media. When I log into emby connect, the server is not shown.

If I manually add the server, I get an "Unable to reach server" message.

I use port 443 as the port when manually adding the server.

I previously had a reverse proxy setup, using a domain name (it was different to the one I am using now) and using port 443 when adding a server manually allowed me to connect from outside my LAN. The server also showed up when I signed in with emby connect. SWAG docker is now not running and port forwarding has been removed from my router (pfSense)

 

 

Edited by markpeo
missing info
Posted

Hi, have you taken a look at this?

 

Posted

I setup cloudflare per sticky instructions. I just checked,  app.emby.media manual login as well as emby connect work fine through my cloudflare tunnel. 

  • Thanks 1
Posted

Thanks Luke, Yes I did read that guide/topic and couldnt find anything that related to my issue.

 

Thanks @KegTappergood to know that it works. I'll keep checking and trying some things.

I think my cloudfare setup is all good, because like I said, I can access via a web browser (direct to my https domain name and it works perfectly!

Im wondering what the android app does differently to a web browser to connect?

Posted
Quote

When I log into emby connect, the server is not shown.

Did you link your server with Emby Connect?

Emby Connect

Posted

Yep, i linked it and it shows when I login with emby connect, but only shows the LAN address and so it does not connect when im outside of the LAN

 

image.png.3fee96e6a1f0c8bbc8b4a52a2765898c.png

Posted
Just now, markpeo said:

Yep, i linked it and it shows when I login with emby connect, but only shows the LAN address and so it does not connect when im outside of the LAN

 

image.png.3fee96e6a1f0c8bbc8b4a52a2765898c.png

Nothing wrong with the fact that it's showing that address. That is just indicating the most recent one used.

  • Like 1
Posted

ok thanks. So when i click it, i just get a message that's its unable to reach the server.

I'll keep trying 🙂

darkassassin07
Posted

A couple settings to check:

 

Public https port number: 443

External Domain: <your domain>

Secure Connection Mode: <anything except 'disabled'>

 

 

Restart the server and ensure 'Remote (WAN) access:' on the dashboard is correct: "https://<yourdomain>" (:443 may or may not be displayed in the end, it's not shown for me anymore in server v4.8)

Posted

HI, thanks for the checklist.

public port number is 443, external domain is set and secure connection mode is set to 'handled by reverse proxy'

:443 does not show at the end, but clicking the external domain link works, so i dont htink its an issue with my remote access setup.

image.png.86877b00a4f559acb805d20eb3a26d5c.png

darkassassin07
Posted

The only other thing I'd suggest is removing the server from connect and re-adding it, now that you've ensured the remote access settings are correct.

If that still doesn't work, I'd be inclined to think there's a bug with connect not receiving the correct connection info.

Posted

unfortunately, that didn't work, same results as earlier - Unable to reach server message

 

  • Solution
Posted

OK, looks like I found the issue. Without realising it, I had 'Under attack mode' turned on in cloudflare.

I changed it to 'High' level security setting, and now I can connect using the android app & emby connect!

So, I guess the app and connect cant beat the interstitial page, but a web browser obviously does.

Thanks for the pointers guys, much appreciated.

image.png.e0925175ffc9eb2b02272c839f044392.png

  • Like 2
  • Thanks 1
  • 2 months later...
Posted

@markpeoHi, I am looking to go down the cloudfare route as I am using a 5G router and Vodafone do not allow port forwarding, can I ask what your overall experience is please? any problems?

 

Thank you!

Posted (edited)

Hi, @mbc0

Experience with CloudFlare tunnel has been great! I only really use it for audio, but have done some testing with video and didn't find any difference between having ports directly open or using a reverse proxy set-up. 

 

Edited by markpeo
  • Like 1
Posted
7 hours ago, markpeo said:

Hi, @mbc0

Experience with CloudFlare tunnel has been great! I only really use it for audio, but have done some testing with video and didn't find any difference between having ports directly open or using a reverse proxy set-up. 

 

Thank you for the reply! Would love to know if anyone is using this for video?

KegTapper
Posted

I use it for video. I have no problems 

Posted
1 hour ago, KegTapper said:

I use it for video. I have no problems 

Thanks for the comment, did you set it up like in this guide? I hear talk of disabling cache for video, can I ask how you did it?

 

 

KegTapper
Posted

Sorry for late response. I already had cloudflare set up as per the sticky instructions as well as caddy. I moved and only isp option was cgnat over wisp. So, I quickly spun up a CF tunnel. I couldn't believe how easy it was. It's been running for close to two years now without any problems.

  • Thanks 1
  • 7 months later...
Posted

Check if Cloudflare's security settings are blocking non-browser requests. Try lowering the security level for your Emby subdomain, like switching from ""Under Attack Mode"" to ""High"" or ""Essentially Off.""


Make sure the external domain in Emby's remote access settings matches what you've set up with Cloudflare Tunnel. You could also try temporarily disabling the Cloudflare proxy (grey cloud mode) to see if that helps.


Using a booter service might also help you identify any issues with how your server handles traffic.

  • 2 weeks later...
Posted

Hey I am having this issue too but my "Under Attack Mode" is disabled. Anyone else figure the solution to this ive been stuck on it for about 12 days now. Just want to use the app on my GF's TV 

Posted
On 1/11/2025 at 12:56 AM, AncyAndal said:

Hey I am having this issue too but my "Under Attack Mode" is disabled. Anyone else figure the solution to this ive been stuck on it for about 12 days now. Just want to use the app on my GF's TV 

Re: 

 

  • 1 year later...
T_Tronix
Posted (edited)

I have a question relating to this topic. My cloudflare is on my hassio (homeassistant server). The cloudflate domain works but cloudflare already added the 8096 port into it. I noticed when I place this domain under the External domain it add an extra 8096.

So lets say my cloudflare domain is: emby.server.com (which is linked to 196.168.1.XXX:8096), Emby makes it emby.server.com:8096 which is basically 196.168.1.XXX:8096:8096 hence it doesn't work when I click on it fromt the emby dashboard but when I use emby.server.com on its own it works but brings me to a login page that doesn't work (no matter what login I use it won't connect me).

image.png.4f54dac417a772cc9c43841019721986.png

Edited by T_Tronix
darkassassin07
Posted (edited)

Domains point at IP addresses, NOT port numbers.

 

Your domain only points to 192.168.1.xxx. With http, web browsers will try port 80 unless told otherwise. (https, they'll try 443)

Cloudflare however is a proxy that is listening to port 80/443, and proxying to port 8096.

Set your 'public http port number' to 80 under 'dashboard'>'network', and the address displayed on the dashboard will work.

Edited by darkassassin07
  • Like 1
T_Tronix
Posted
10 minutes ago, darkassassin07 said:

Domains point at IP addresses, NOT port numbers.

 

Your domain only points to 192.168.1.xxx. With http, web browsers will try port 80 unless told otherwise. (https, they'll try 443)

Cloudflare however is a proxy that is listening to port 80/443, and proxying to port 8096.

Set your 'public http port number' to 80 under 'dashboard'>'network', and the address displayed on the dashboard will work.

Now both lan and wan don't work. I set the port from 8096 to 80 inside my Emby server http port. In cloudflare I have:

  - hostname: emby.server.com
    service: http://192.168.1.xxx:8096

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...