http-to-https-proxy
http-to-https-proxy copied to clipboard
fix: strip port off the hostname.
The proxy tries to append the https port number directly on the hostname, which contains the http port number. This fix strips the port from the hostname.
Thanks for your contribution. I'm currently very busy at the moment. I will get back to this fix once I'm available.
What if the destination actually requires that custom port ?
Assuming we are using this proxy because we know what we are doing it might be actually better to leave the port intact in such cases (except when for whatever reason :80 is in the host) and initiate TLS on that port.
For example app receives an URL that is only accessible through HTTPS on custom port but it can't handle it so it forwards this request to this proxy which uses the same port number to grab data through HTTPS.
Optionally, this behavior could be made to switch on whenever we request URL with http or https in the URL.
This is something I'm working on in my fork, plus few additions for personal use case, you can see the changes in my feature branches, if you like any of those branches then I'll be happy to PR them.