support both http and https