mescon / Muximux

A lightweight way to manage your HTPC
GNU General Public License v2.0
1.14k stars 82 forks source link

Allow specification of webservers on same ip you use to access site #67

Closed seertenedos closed 8 years ago

seertenedos commented 8 years ago

Basically i am running this site on a docker container on a server who's ip can change. It would be great if you could have a way to specify a site/url is just a different port on the same ip.
eg if i was hitting Muximux on 192.168.1.2 then instead of putting http://192.168.1.2:8080 for sonarr i could just put http://*:8080 or something like that and the site would replace * with the ip address/hostname you are currently using to load the page. That way if i hit the website on 192.168.1.3 then the urls would all still function.

mescon commented 8 years ago

This is a networking problem and is unrelated to Muximux itself.

seertenedos commented 8 years ago

how is it not related to Muximum? It is about just been able to type a port in instead of a host name for a site and the hostname from the request would be used for the hostname instead. it can't be done outside the software as your software is the only thing that knows the hostname the user entered into the browser. This would also make things easier for people that run many services either on the same computer or via docker as they can just put the ports in not the whole ip or hostname and it would work. All the info needed is in the http request as you just need the hostname without the port for the current request you just received.

mescon commented 8 years ago

So why not just add the same domain that you use to access Muximux (example.com) and just add example.com:8080?

This whole problem is what domain name servers are for (if the IP changes, use dynamic DNS to keep the domain name up to date - if it's internal, reserve a specific IP for the mac address of your docker instance in your DHCP server). Not being able to type in a port such as test is because (afaik) most web browsers do not implement it.

Sure, it could be implemented with javascript (see http://stackoverflow.com/a/6016361 for instance), but then Muximux would have to present the user with even more settings to decide if they want to link a URL or if they want Muximux to find the local URL and append the port - which would have to be saved to the config. This whole niche problem adds clutter to the settings (imo), and is not really a Muximux problem to solve.