zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
954 stars 39 forks source link

[FEATURE REQUEST] Support export HTTPS_PROXY, HTTP_PROXY #29

Closed patsevanton closed 2 years ago

patsevanton commented 2 years ago

Hello!

Please support export HTTPS_PROXY, HTTP_PROXY

Thanks

zyedidia commented 2 years ago

Could you describe an example use-case and what the behavior would be?

patsevanton commented 2 years ago

I try install terraform

user@homepc:~$ export https_proxy=http://xxxxxx:3128/
user@homepc:~$ sudo ./eget  https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_linux_amd64.zip  --to /usr/local/bin
https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_linux_amd64.zip
Downloading 100% [============================================================================================================] (423/423 B, 5.176 MB/s)
zip: not a valid zip file

Try download by wget

user@homepc:~$ export https_proxy=http://xxxxxx:3128/
user@homepc:~$ wget  https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_linux_amd64.zip
--2022-05-03 20:52:31--  https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_linux_amd64.zip
Connecting to 193.233.204.249:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 19262029 (18M) [application/zip]
Saving to: ‘terraform_1.1.9_linux_amd64.zip’

terraform_1.1.9_linux_amd64.zip         100%[===============================================================================>]  18.37M  2.21MB/s    in 15s

2022-05-03 20:52:48 (1.22 MB/s) - ‘terraform_1.1.9_linux_amd64.zip’ saved [19262029/19262029]
dufferzafar commented 2 years ago

@patsevanton I've created a fix for this, but I'm not really sure if this will fix all your issues.

Will you be up for testing this before we can merge the PR?

If you have a Golang build environment, could you check out & build my branch?

or if that will take time, I could provide you an amd64 binary and you could run that to test?

dufferzafar commented 2 years ago

@zyedidia BTW, I saw that the releases that you upload to GitHub are all static binaries.

But when I do make build in the eget repo, I get a dynamic binary. What's up with that? How can I get a static binary that I can pass on to @patsevanton?

dufferzafar commented 2 years ago

As described here

I had to change the make build command to: CGO_ENABLED=0 go build -trimpath -ldflags '-s -w -X main.Version=1.1.1-dev.1 -extldflags "-static"' . to get a static binary.

@patsevanton Here is a release with a binary that I believe should handle proxies correctly: https://github.com/dufferzafar/eget/releases/tag/v1.1.0