When a program asks an HTTP proxy for an https address, it sends the word CONNECT with the site's name and port. The proxy opens a raw connection to the site and from then on only passes bytes back and forth. The encryption is between your program and the site, so the proxy sees which site you reached and how much data moved, not what it said.
In practice this means one proxy address covers both kinds of site. The proxy address itself still starts with http://, even when the page you fetch is https. Writing https:// in front of the proxy host is a common mistake and makes most programs fail to connect.
Read next: Code examples for curl, Python and Node.js