问题
This is a well-known bug that cabal
can not handle proxies in format http://user:password@host:port
format. On Haskell mailing list, someone suggested a patch to overcome this but that patch is now quite old.
It fails with following message
Downloading the latest package list from hackage.haskell.org
Warning: invalid http proxy uri:
"http://user:pass@host:80/"
Warning: proxy uri must be http with a hostname
Warning: ignoring http proxy, trying a direct connection
Does anyone know how to make cabal use my proxy settings? Any indirect method will also do such as proxy bypassing etc.
A similar question is asked on superuser but it is not answered there.
回答1:
I have got it working with polipo. My university uses http-proxy
with authentication. In /etc/polipo/config
you need to add these lines
parentProxy = "proxy.server.com:80"
parentAuthCredentials = "myusername:mypassword"
And export http_proxy=http://localhost:8123"
. And it worked like a charm.
来源:https://stackoverflow.com/questions/9310218/cabal-fails-with-proxy-with-authentication