Make ajax proxy server flexible with HTTP and HTTPs