pir8radio 1292 Posted January 23, 2017 Share Posted January 23, 2017 (edited) I know this request wont get much traction because only a hand full of people are using/would want to use cloudflare. But I would like to request a feature that allows you to set a streaming domain name in emby, so that any requests for Audio or Video files get directed to this second domain name. It would be the same server but a different request path just for the streaming files within the master/main playlists. For example normal emby server address embyserver.com if any client plays content i want the content to be requested from stream.embyserver.com. This is handy for cloudflare because you can benefit from all of the CSS, JS, HTML, and image caching on their edge servers, offloading all of that content from your local emby server while keeping the actual streams off of cloudflares reverse proxy by bypassing the stream.embyserver.com domain within cloudflare. If this is not something you would consider, who does most of the JavaScript programming within emby? Particularly the hls.min.js or whatever is building the playlists for transcoded files, maybe i can get a hand making some changes on my end for testing.. Edited January 24, 2017 by pir8radio Link to comment Share on other sites More sharing options...
funwithmedia 352 Posted January 24, 2017 Share Posted January 24, 2017 It sounds like you'd want to route everything to Cloudflare, except for video / audio files of all kinds (including things like .mpeg, mkv, etc.), so not just limited to VIDEO_TS folder rips. Correct? I've not gotten into accessing Emby remotely, but as a fellow user this is certainly an interesting idea. Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 24, 2017 Author Share Posted January 24, 2017 (edited) It sounds like you'd want to route everything to Cloudflare, except for video / audio files of all kinds (including things like .mpeg, mkv, etc.), so not just limited to VIDEO_TS folder rips. Correct? I've not gotten into accessing Emby remotely, but as a fellow user this is certainly an interesting idea. That is correct. Anything coming from the /emby/VIDEO/ or emby/AUDIO paths would be nice. edited my original post. Edited January 24, 2017 by pir8radio Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 24, 2017 Author Share Posted January 24, 2017 @@ebr can you have someone delete this entire thread.... I just found cloudflare supports redirects out of the box, and i got this working... Link to comment Share on other sites More sharing options...
funwithmedia 352 Posted January 24, 2017 Share Posted January 24, 2017 Actually, rather than delete the thread, why don't you provide some direction (even just a link or two) for others, in case someone else wants to explore this at some point? 1 Link to comment Share on other sites More sharing options...
ebr 14913 Posted January 24, 2017 Share Posted January 24, 2017 Yeah, I was going to say - won't CF support this already? So, do complete this by posting how to set it up and then we can mark it solved. Thanks. Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 24, 2017 Author Share Posted January 24, 2017 (edited) You just need to do a rule that redirects all traffic to a specific url, however if you do not pay for additional "Page Rules" you will be forced to have your "stream.yourdomain.com" path run in either https or http not dynamically match what your clients are using. Video stream redirect: Page rule url: *yourdomain.com/emby/videos/* Forwarding url: https://stream.yourdomain.com/emby/videos/$2 Status code: 302 - Temporary Redirect (don't make it permanent, if you ever shut off CF you will have headaches) Audio stream redirect: Page rule url: *yourdomain.com/emby/audio/* Forwarding url: https://stream.yourdomain.com/emby/audio/$2 Status code: 302 - Temporary Redirect (don't make it permanent, if you ever shut off CF you will have headaches) Add a CURL to your CF setup for stream.yourdomain.com and click the orange cloud so it turns grey, bypassing all proxy/caching that CF does. If you pay for additional page rules you can create 4 rules two for http, and two for https so you are not forced to one or the other. those rules would look something like below, except you will have 4 rules: HTTP only rule: Page rule url: http://*yourdomain.com/emby/videos/* Forwarding url: http://stream.yourdomain.com/emby/videos/$2 Status code: 302 - Temporary Redirect (don't make it permanent, if you ever shut off CF you will have headaches) HTTPS only rule: Page rule url: https://*yourdomain.com/emby/videos/* Forwarding url: https://stream.yourdomain.com/emby/videos/$2 Status code: 302 - Temporary Redirect (don't make it permanent, if you ever shut off CF you will have headaches) and the same for the /audio/ path. Edited January 24, 2017 by pir8radio Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 24, 2017 Author Share Posted January 24, 2017 @@ebr Well the above works for web based, and iphone apps, but it looks like fireTv does not handle 302 redirects? Is that a true statement? Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 25, 2017 Author Share Posted January 25, 2017 (edited) so i need help from one of the javasript gurus to help me insert https://stream.mydomain.com into hls.min.js , so that the master playlist is built with an absolute url (my specific one) vs the relative one. Please. I assume its near buildAbsoluteURL somewhere... but It will take me forever to figure it out on my own.lol Edited January 25, 2017 by pir8radio Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 25, 2017 Author Share Posted January 25, 2017 no one willing to help me hard code my stream url into hls.min.js? Link to comment Share on other sites More sharing options...
Happy2Play 8282 Posted January 25, 2017 Share Posted January 25, 2017 no one willing to help me hard code my stream url into hls.min.js? Visibility for a request like this is going to limited in the Feature request forum. And additionally something that has to be applied with every release. Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 25, 2017 Author Share Posted January 25, 2017 I was just looking for help to point me where to edit my copy. nginx can dynamically rewrite as it sends to the client so versions can change. But i guess this is more of an issue with emby not being able to handle 302 redirects, so I'll post that as an issue. thx Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted January 26, 2017 Author Share Posted January 26, 2017 Just to update this thread, there may or may not be an issue with two emby clients handling 302 redirects, so the above suggestion to bypass CloudFlare when sending a stream is how you would want to do this, except it breaks playback on Roku and FireTv/Android (which the team is looking into) due to the redirect. Link to comment Share on other sites More sharing options...
Guest plexman Posted December 26, 2017 Share Posted December 26, 2017 How is the status of this? I've tested on Chromecast and happens the same as Roku and FireTV/Android, it is not able to handle 302 redirects. Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted December 27, 2017 Author Share Posted December 27, 2017 (edited) How is the status of this? I've tested on Chromecast and happens the same as Roku and FireTV/Android, it is not able to handle 302 redirects. They were looking into it to see if those devices did not support 302 redirects, they were not looking into it to fix it, thought that would be nice. Edited December 27, 2017 by pir8radio Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now