Modification that will recognize HTTP protocol used and modify the base variable accordingly

Currently there is a hardcoded variable with "http://" as a protocol. This is not suited for all situations as one might want to use SSL for such important service as reporting.