cabal can't use http proxy

早过忘川 提交于 2019-12-05 09:59:01

You can use cntlm to talk to proxy. It will handle authentication issues. After configuring and installing cntlm, set up the new environmental variable by modifying http_proxy, https_proxy etc.

Your cabal command should work after that.

swang

some detailed procedure here:

  1. Download cntlm from here It's a c program with no other dependencies so very easy to make, just follow the instructions in the downloaded package.

  2. After installing cntlm, follow this answer from Colonel Panic. Obviously on linux you need to change cntlm.exe to ./cntlm, I named the configure file cntlm.conf

  3. The default listen port for cntlm is 3124, if you can't use that port, change it to something else like 53124, then add this to your cntlm.conf or cntlm.ini file:

    Listen              127.0.0.1:53124
    
  4. Start cntlm in the background:

    
    ./cntlm -c cntlm.conf
    
  5. Change your http_proxy environment variable to talk to the cntlm process rather than the real proxy.

    
    export http_proxy=http:// 127.0.0.1:53124
    

That's it, cabal will work as good as ever.

Xusheng Zhang

You can also setup the http_proxy directly in the system setting:

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