Windows 7 命令提示符的代理设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24657501/
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
Proxy Settings for Windows 7 Command Prompt
提问by cbruno
I am trying to use cURL in the Command Prompt, but I dont understand where I have problems. I have been told that I need to configure a proxy tothe Command Prompt so that it can access the sites I am calling on.
This is what I want to run: curl -glob "api.fda.gov/drug/event.json?&search=receivedate:[20040101+TO+20150101]&limit=1"
I have cURL installed, but always face errors because it is not connecting. Is there a simple way to set up a proxy for/through the Command Prompt in Windows 7?
我试图在命令提示符中使用 cURL,但我不明白我在哪里遇到问题。有人告诉我,我需要为命令提示符配置一个代理,以便它可以访问我正在调用的站点。
这就是我想要运行的:curl -glob "api.fda.gov/drug/event.json?&search=receivedate:[20040101+TO+20150101]&limit=1"
我安装了 cURL,但总是遇到错误,因为它没有连接。是否有一种简单的方法可以为/通过 Windows 7 中的命令提示符设置代理?
I also do not have admin rights, so I cannot change the system settings.
我也没有管理员权限,所以我无法更改系统设置。
回答by Koby Douek
You can set your proxy using a set
command in windows:
您可以set
在 Windows 中使用命令设置代理:
set http_proxy=http://<yourproxyaddress>:<port>
Then you can connect your curl requests to external sites.
然后,您可以将 curl 请求连接到外部站点。
回答by Ostati
Some proxies require specific authentication headers to be set, so be aware of those as well. In my case, it's --proxy-ntlm
in the example below:
某些代理需要设置特定的身份验证标头,因此也要注意这些标头。就我而言,它--proxy-ntlm
在下面的示例中:
curl -x webproxy.net:8080 -U usernaname:password http://google.com --proxy-ntlm
But there're other options:
但还有其他选择:
--proxy-digest
and --proxy-negotiate
--proxy-digest
和 --proxy-negotiate
Lastly, cURL has a super friendly doc page, so be sure to check it out.
最后,cURL 有一个超级友好的文档页面,所以一定要检查一下。