Closed alanmilinovic closed 5 years ago
Any comments? Does it make sense?
A proper solution would be to make sure your hostname resolves correctly on your local network, then you wouldn't need any hacks like this.
How to achieve that?
Actually, take a look at https://github.com/Jalle19/xbmc-video-server/wiki/Configuring-a-reverse-proxy. With that configured you can use the IP address for youe backend while accessing the application from "outside" too.
Don't like reverse proxy solution that much though. I also need to put password in apache2 config file. Personally I think my feature request is quite ok. :)
Reverse proxying has it's problems, but IMO it's the best solution here. I'm not completely sure how your suggestion is supposed to work either so it's hard to say. Generally you don't want to have your application work around network configuration problems.
Actually I now understand what you mean, although it would only work if you run the backend and this application on the same machine, right?
Yes, it should be a flag where you configure backend, like a property on the form. In case when user set flag to true, hostname field can be disabled, because it is then taken from URL and not needed.
I reopened the issue in case you decide to implement it. :) If you are not planning to give it a go, please close the issue.
Since it would only work if the application is installed on the same machine as the backend I'm not really comfortable implementing such a workaround. It's much better to just configure a reverse proxy instead.
Your suggestion with reverse proxy is working. In my case, I configured "localhost" for the Backend hostname and in Apache config as well for the url.
As already mentioned I had to configure Kodi url and credentials one more time in Apache, what I find not so comfortable about but I will have to live with it. Thank you for your support.
I know there is a posibility to add more backends and switch between then while using xbmc server web application. In my case I use backend that is located on the same machine (raspberry pi) where xbmc server is installed.
What I did of course I configured in my xbmc server backend, fixed IP address (192.168.188.201) for the "hostname". Thing is that sometimes I open application inside my home with IP and sometimes I open it outside from my home. In case when I use it outside, hostname should be this "1raspberrypi.mooo.com" and if I use it with this domain name and try to download some video it is pointing to local IP. What of course doesn't work for that case.
Is it possible to add an option in backend record to support getting backend hostname by parsing of hostname from the URL? I think this "$_SERVER['SERVER_NAME']" should be used if this type of backends are marked with checkbox for example. Not sure on how many places you use backend hostname from the database in code but should be easy to implement it, I think, of course if you have free time and want to do it. It would be highly appreciated. :)