Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cabal can't use http proxy

My Linux(redhat6) server has to use http proxy to connect to outside world. While it works for other things like wget, it doesn't work for cabal.

cabal update -v3

shows errors like this:

407 - proxy authentication required cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Unsucessful HTTP code: 407"

I tried to change http_proxy environment variable to format like http:// user: passwd at proxy:port, but it doesn't work either.

The same problem has been asked here

But I'm not allowed use a proxy server like polipo, is there any other way to make cabal work behind a proxy?

like image 354
swang Avatar asked Oct 20 '22 10:10

swang


1 Answers

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.

like image 158
Sibi Avatar answered Oct 30 '22 02:10

Sibi