Implemented support for both HTTP and HTTPS