gpt4 book ai didi

node.js - 如何配置 Chocolatey 以使用公司代理?

转载 作者:可可西里 更新时间:2023-11-01 13:31:42 27 4
gpt4 key购买 nike

我在通过公司代理安装 Chocolatey 软件包时遇到问题。 Internet Explorer 配置正确,但我在通过 PowerShell 运行它时遇到问题。

我可以使用 Web 客户端下载页面,例如Microsoft.com,但最终 Chocolatey 无法通过提示下载包

"Please provide proxy credentials:"

这不会接受我的域登录是有效的。有时我只是得到错误

"Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (407) Proxy Authentication Required."

我有两台机器 - 其中一台可以正常下载包,另一台给出上述错误,但它们都显示直接访问(如下所示):

PS C:\Windows\system32> netsh winhttp import proxy source=ie

Current WinHTTP proxy settings:

Direct access (no proxy server).


PS C:\Windows\system32> netsh winhttp show proxy

Current WinHTTP proxy settings:

Direct access (no proxy server).

我不太确定这里发生了什么。有什么建议吗?

最佳答案

Chocolatey 在 https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey 有代理说明尤其是有关显式代理 的部分。确保您安装了正确版本的 choco 才能正常工作。如果那不正确,我们应该修复文档/choco 以使其正确。

为了后代:

Explicit Proxy Settings

Chocolatey has explicit proxy support starting with 0.9.9.9.

You can simply configure 1 or 3 settings and Chocolatey will use a proxy server. proxy is required and is the location and port of the proxy server. proxyUser and proxyPassword are optional. The values for user/password are only used for credentials when both are present.

choco config set proxy <locationandport>
choco config set proxyUser <username>
choco config set proxyPassword <passwordThatGetsEncryptedInFile>

Example

Running the following commands in 0.9.9.9:

choco config set proxy http://localhost:8888
choco config set proxyUser bob
choco config set proxyPassword 123Sup#rSecur3

关于node.js - 如何配置 Chocolatey 以使用公司代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34263774/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com