Cabal fails with proxy with authentication

*爱你&永不变心* 提交于 2019-12-20 05:58:17

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!