How can I get Cabal to bypass Windows proxy settings?

When I receive packages using Cabal, I often get errors with this message:

User Error (Codec.Compression.Zlib: Premature End of Compressed Stream)

Cabal seems to be using the Windows Network proxy server settings (for Privoxy).

From digging around Google, Cabal or its library seems to have had a problem in this area.

Possible solutions that I see are as follows:

  • Disable proxying when using Cabal (not very keen on this); or

  • Get the patch and start hacking. I do not dare to follow this path, as I am a complete Haskell noob, and I am not yet satisfied with Darcs; or

  • Give him the magic parameter "Can I make mistakes without a proxy." Hence the question.

+4
source share
2 answers

If I read http://darcs.haskell.org/cabal-install/Distribution/Client/HttpUtils.hs correctly, you must set the HTTP_PROXY environment variable to an invalid value (will "" work? "To make it go straight.

+4
source

Following @SamB's advice and experimenting a bit, I use the following solution:

export HTTP_PROXY="::" 

Here is part of the experimental journal:

Try the @SamB solution:

 [12:10:35z ~]:export HTTP_PROXY="" [12:11:47z ~]:set|grep HTTP HTTP_PROXY= [12:11:50z ~]:cabal update Downloading the latest package list from hackage.haskell.org cabal.exe: connect: failed (Connection refused (WSAECONNREFUSED)) 

Try the "smart person" solution:

 [12:11:54z ~]:export HTTP_PROXY="None" [12:12:02z ~]:set|grep HTTP HTTP_PROXY=None [12:12:04z ~]:cabal update Downloading the latest package list from hackage.haskell.org cabal.exe: user error [\] (openTCPConnection: host lookup failure for "None") 

Try the "foolish person" solution:

 [12:23:44z ~]:export HTTP_PROXY="::" [12:24:00z ~]:set|grep HTTP HTTP_PROXY=:: [12:24:04z ~]:cabal update Downloading the latest package list from hackage.haskell.org Warning: invalid http proxy uri: "::" Warning: proxy uri must be http with a hostname Warning: ignoring http proxy, trying a direct connection Note: there is a new version of cabal-install available. To upgrade, run: cabal install cabal-install [12:24:34z ~]: 

Yay

+4
source

Source: https://habr.com/ru/post/903320/


All Articles