moonrepo / proto

A pluggable multi-language version manager.
https://moonrepo.dev/proto
MIT License
677 stars 34 forks source link

Feature request: allow http url as https proxy #594

Closed AiHMin closed 1 month ago

AiHMin commented 2 months ago

What version?

0.39.0

Which command?

proto install

What happened?

Proto now uses the prefixes http: and https: to distinguish between an HTTP proxy and an HTTPS proxy. Is it possible to specify an HTTP address (e.g. http://127.0.0.1:xxx) for an HTTPS proxy?

This is particularly useful when the proxy address is set to 127.0.0.1.

Trace logs?

No response

Operating system?

MacOS

Architecture?

arm64

milesj commented 2 months ago

This is tricky, because not all 127.0.0.1 local URLs are https, most of them are http, so how is proto supposed to know the difference? Maybe if it has the 443/8443 ports?

AiHMin commented 2 months ago

Is it possible to let the configuration file tell proto which are http and which are https? e.g.:

[settings.http]
http-proxies = ["http://127.0.0.1:1234", "http://proxy-url"]
https-proxies = ["http://127.0.0.1:1234", "https://proxy-url"]

or

[settings.http]
proxies = ["http://127.0.0.1:1234", "http://proxy-url"]

[settings.https]
proxies = ["http://127.0.0.1:1234", "https://proxy-url"]
milesj commented 2 months ago

I'd rather not introduce a breaking change for config. Maybe secure-proxies? I'll have to think about this.

bjoern-reetz commented 2 months ago

I think I'm running into the same issue: Failed to use proto behind my corporate proxy which is always HTTP with some random port for both HTTP/HTTPS connections (e.g. export https_proxy=http://some.host:8000). Proto looks real awesome and I am eager to trying it out in the office.

milesj commented 2 months ago

Yeah I think I should support this in some fashion. I'll look into it for the next version.

But like you said, proto should support the HTTP_PROXY and HTTPS_PROXY env vars.

bjoern-reetz commented 2 months ago

Thank you so mich for your real quick reply! Well, I tried configuring the proxy via env vars but failed - maybe I have a different problem (or maybe I‘m just using it wrong 😅). May I open a seperate issue with a more detailed report?!

milesj commented 1 month ago

I added secure-proxies, give that a try.

AiHMin commented 1 month ago

I think it works very well. Great work! I will close this issue.