Support HTTPS web sites

When I have a Joomla web site which I access trough https, then the apps Base Urls needs to point to the https cdn.
This PR doesn't only change the cdn url to https but considers the actual browser connection. This works for http and none https connections from the client side.

More robust for #3 and #4.