http and https support
refactor, adds support for either/or/and http/https