To generates the correct HTTPS URL, you must set proper protocol in the api_domain entry.
api_domain
Update scramble.php config file like this: api_domain=https://github-codespace-domain-and-port.github.com
scramble.php
api_domain=https://github-codespace-domain-and-port.github.com