[Pitch] Package Manager HTTP Proxy Configuration

I think this would be a nice addition! And I agree with the change to have env variables take highest precedence.

Some thoughts:

  1. I would suggest adding a --global flag to the CLI to edit/view the global (~/.swiftpm/configuration/proxy.json) file, similar to this proposal: SE-0535: Add CLI for editing global mirrors configuration - #4 by 0xTim.

  2. The proposal mentions the registry configuration, and has this a "alternative considered" location for this configuration. I think maybe the mirror configuration would be more reasonable (though I think reasoning for not choosing it carries over from what you have currently).

  3. I think also that the motivation should mention the mirror configuration somehow, since that is one way to solve the problem currently. With that, you can already re-map git and binary URLs to internal domains. To be clear, I don't disagree with the proposal to add this feature, but I think it should relate it to the mirror configuration, and why that might not be a good alternative in some cases.

  4. Speaking of the mirror configuration, I think it would be nice if the proposal mentioned this, and how the proxy and mirror configuration would interact. If I set both, how will the resolve which URL to go to? Will it first "translate" the original URL via the mirror configuration, and then check the proxy configuration for that URL?

1 Like