从 Windows 命令提示符中删除代理设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30406136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove proxy settings from the windows command prompt
提问by ant_1618
I had set proxy settings in cmd when I was in a proxy network as follows:
当我在代理网络中时,我在 cmd 中设置了代理设置,如下所示:
set http_proxy=http://username:pass@hostname:port
set http_proxy=http://username:pass@hostname:port
set https_proxy=https://username:pass@hostname:port
set https_proxy=https://username:pass@hostname:port
Now that I am on a normal network I want to unset the proxy settings in the command prompt.Is there any direct command that would let me unset the http_proxy
and https_proxy
environment variables directly for the command line rather that navigating through the GUI to delete them?
现在我在普通网络上,我想在命令提示符中取消设置代理设置。是否有任何直接命令可以让我直接为命令行取消设置http_proxy
和https_proxy
环境变量,而不是通过 GUI 导航来删除它们?
回答by user5589186
try,
尝试,
set http_proxy=
set https_proxy=
回答by G_Style
From an elevated command prompt (CMD or PS) type:
从提升的命令提示符(CMD 或 PS)键入:
netsh winhttp reset proxy
netsh winhttp reset proxy
This should produce:
这应该产生:
C:\Windows\system32>netsh winhttp reset proxy
Current WinHTTP proxy settings:
Direct access (no proxy server).
C:\Windows\system32>netsh winhttp reset proxy
Current WinHTTP proxy settings:
Direct access (no proxy server).
This command will reset your proxy settings and as you can see by the output, they will be set to "no proxy server."
此命令将重置您的代理设置,正如您在输出中看到的那样,它们将设置为“无代理服务器”。
You can also type netsh winhttp show proxy
to see what your current settings are.
您还可以键入netsh winhttp show proxy
以查看您当前的设置。
回答by Manpreet Kaur
npm config delete proxy http
npm config delete proxy https
回答by tushar
When you write proxy by set http_proxy=http://username:pass@hostname:portthen it might get remove just on exit the command prompt.
当您通过set http_proxy= http://username:pass@hostname:port编写代理时,它可能会在退出命令提示符时被删除。
But further you can reset it via netsh winhttp reset proxy. Run command as administrator
但进一步您可以通过netsh winhttp reset proxy重置它 。以管理员身份运行命令