问题
I always have been using mix behind proxy at least just 2 weeks ago. However I found that mix becomes not to be able to work behind proxy yesterday. mix version is 1.1.1. mix local.hex runs. But mix deps.get occurs errors.
$ mix deps.get
Registry update failed (http_error)
{:failed_connect, [{:to_address, {'s3.amazonaws.com', 443}}, {:inet, [:inet], :nxdomain}]}
Running dependency resolution
Dependency resolution completed successfully
combine: v0.5.3
floki: v0.6.1
hackney: v1.3.2
httpoison: v0.7.4
idna: v1.0.2
mochiweb: v2.12.2
ssl_verify_hostname: v1.0.5
timex: v0.19.5
tzdata: v0.5.4
* Getting httpoison (Hex package)
Checking package (https://s3.amazonaws.com/s3.hex.pm/tarballs/httpoison-0.7.4.tar)
Request failed: {:failed_connect, [{:to_address, {'s3.amazonaws.com', 443}}, {:inet, [:inet], :nxdomain}]}
** (Mix) Package fetch failed and no cached copy available
The proxies are set by HTTP_PROXY and HTTPS_PROXY. I also set .gitconfig as;
[http]
proxy = http://proxy.mycompany.co.jp:10080
[https]
proxy = http://proxy.mycompany.co.jp:10080
[url "https://"]
insteadOf = git://
Is it the problem about proxy itself and are there some workaround about this?
回答1:
This was a regression in the last version of Hex, it should be fixed in the next release (this weekend probably). You can work around it by cloning https://github.com/hexpm/hex and running mix install
to install the development version. mix local.hex
will revert back to stable.
来源:https://stackoverflow.com/questions/33898007/mix-does-not-work-behind-proxy