Fix downloading HTTPS file with HTTP proxy
Fix downloading HTTPS file with HTTP proxy

HttpProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTP requests.
HttpsProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTPS requests.

So we should choose agent based on the destination instead of the proxy URL.

Former-commit-id: 0501f2676c4baa7c748be728697eac89eedb93b0
Former-commit-id: 76903012dbe1ed2b1d0262327227731822d6875d
prisma/prisma,prisma/prisma,prisma/prisma