如何为 Cabal 设置代理?

Syn*_*sso 10 proxy

我在 (Windows) 代理后面使用 Ubuntu。我想使用该cabal实用程序。

jem@Respect:~$ cabal update
Config file path source is default config file.
Config file /home/jem/.cabal/config not found.
Writing default configuration to /home/jem/.cabal/config
Downloading the latest package list from hackage.haskell.org
Warning: invalid http proxy uri:
"http://domain\\user:pass@internetproxy:3128/"
Warning: proxy uri must be http with a hostname
Warning: ignoring http proxy, trying a direct connection
^C
Run Code Online (Sandbox Code Playgroud)

已从环境中读取代理 URL。我的代理需要身份验证,但 cabal 希望代理 URL 以主机名开头,因此它可能会提示我输入凭据...

jem@Respect:~$ http_proxy=http://internetproxy:3128/ cabal update
Downloading the latest package list from hackage.haskell.org
No action for prompting/generating user+password credentials  provided (use: setAuthorityGen); returning Nothing
cabal: Failed to download index 'ErrorMisc "Unsucessful HTTP code: (4,0,7)"'
Run Code Online (Sandbox Code Playgroud)

什么是setAuthorityGen以及如何使用它?更重要的是,我可以通过身份验证代理启用访问吗?我需要隧道吗?

小智 2

我的 ISA 代理标准方法是配置本地身份验证代理,例如cntlm。在 Ubuntu 计算机上安装 cntlm 后,将其配置为使用 Windows 用户名和密码通过 ISA 代理上的 NTLM 进行身份验证。然后将HTTP_PROXY变量设置为http://localhost:3128(即 cntlm 正在侦听的端口)。

这种方法的优点是只有一个程序必须处理 Windows 代理。所有其他程序都可以使用 cntlm 作为网关来通过。