Check $_SERVER['HTTPS'] if empty will check server connection port