Adding code to talk to the host using HTTP and HTTPS.