benschw / satis-go

GNU General Public License v3.0
96 stars 21 forks source link

support for proxy #3

Open warroyo opened 8 years ago

warroyo commented 8 years ago

I am using satis behind a corporate proxy, is there any way to enable the use of this?

benschw commented 8 years ago

What problem are you running into? Are you trying to access it from outside of the office? Is the proxy interfering with the satis server within the office?

warroyo commented 8 years ago

The issue is that when I try to add new repos through the admin it unable to access the repos because I am behind a proxy. It does not seem to respect the http_proxy env variables.

benschw commented 8 years ago

(Sorry, I've been busy lately)

This seems pretty reasonable, could you post some links to how this environment variable should be handled? It doesn't sound like it will be a problem to add in

warroyo commented 8 years ago

This link should help out some, you will want to use those three ENV variables.

if you are using net/http then you could modify the transport on your rest call

proxyUrl, err := url.Parse("proxyurl from environment")
http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyUrl)}

does this help?

benschw commented 8 years ago

Sorry, I've been busy. I will try to get to this soon, but it looks like you have an idea of how to fix it. feal free to submit a PR