nakabonne/ali

Natively support specifying HTTP proxies

hazcod opened this issue · 3 comments

I've had very mixed results for some reason specifying the environment variable HTTP_PROXY to Ali.
Not sure if this is related, but it would be nice to natively support supplying a proxy via an argument.

e.g. curl uses -x.

@hazcod Hi, thank you for reporting. I'm aware that net/http.Client automatically switches to use the given proxy if you set the HTTP_PROXY environment variable, but I might be wrong. Could you tell me a little bit more about what mixed results you've had?

I'll close this for now since it seems to work reliably with a system environment variable, but not when I declare it in a process way:

# sometimes works
% HTTP_PROXY="http://127.0.0.1:8080" ali https://google.com/

# always works
% docker run --rm -ti -e 'HTTP_PROXY=http://127.0.0.1:8080' nakabonne/ali ali https://google.com/

@hazcod Hmm, interesting. Okay, feel free to open it when needed 👍