Haskell 如何让Cabal绕过我的Windows代理设置?
使用Cabal检索包时,我经常收到以下消息错误: 用户错误(Codec.Compression.Zlib: 压缩流过早结束) 看起来Cabal正在使用我的Windows网络代理设置(用于Privoxy) 从谷歌周围的挖掘中,阴谋集团或其图书馆似乎遇到了问题 在这个地区 我能看到的可能解决方案有:Haskell 如何让Cabal绕过我的Windows代理设置?,haskell,cabal,Haskell,Cabal,使用Cabal检索包时,我经常收到以下消息错误: 用户错误(Codec.Compression.Zlib: 压缩流过早结束) 看起来Cabal正在使用我的Windows网络代理设置(用于Privoxy) 从谷歌周围的挖掘中,阴谋集团或其图书馆似乎遇到了问题 在这个地区 我能看到的可能解决方案有: 使用阴谋集团时关闭代理(不太喜欢这个);或 获取补丁并开始黑客攻击。我对走这条路犹豫不决, 因为我是一个彻头彻尾的哈斯凯尔·努伯,我还不适应DARC;或 给它一个神奇的“CaniHaz无代理”参数。这就
如果我的阅读正确,您应该能够将环境变量HTTP_PROXY设置为无效值(“工作吗”)以使其直接运行。遵循@SamB的建议,并进行一些实验,我现在使用的解决方案是:
export HTTP_PROXY="::"
以下是实验日志的一部分:
尝试@SamB的解决方案:
[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))
[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")
[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 ~]:
尝试“理性人”的解决方案:
[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))
[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")
[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 ~]:
尝试“不讲道理的人”的解决方案:
[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))
[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")
[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 ~]:
耶 谢谢你。我现在正在路上,希望能在复活节期间试一试。好的,测试过了。我遵循了你的指导方针,最终成功了。我已经接受了你的答案+1,并根据你的提示发布了我的解决方案。再次感谢。我不知道你为什么称之为“不合理的人”的解决方案——我说过你应该尝试一个无效的值:-)。