我有这个代理地址:125.119.175.48:8909

如何使用cURL(如cURL http://www.example.com)执行HTTP请求,但指定我的网络的代理地址?


当前回答

对于http代理隧道(TLS协议需要),您需要指定-p(即——proxytunnel)而不是-x。

关于代理的Curl帖子

代理隧道使用新的“CONNECT”关键字而不是修改过的“GET”关键字

这是节点http-proxy-中间件库所需要的。

只有当我使用wget时,我才得到一个线索。

其他回答

来自man curl:

-x, --proxy <[protocol://][user:password@]proxyhost[:port]>

     Use the specified HTTP proxy. 
     If the port number is not specified, it is assumed at port 1080.

一般方法:

export http_proxy=http://your.proxy.server:port/

然后,您可以通过代理从(许多)应用程序连接。

而且,正如下面的评论,对于https:

export https_proxy=https://your.proxy.server:port/
curl -x socks5://username:password@ip:port example.com

旋度vv -ksL“https://example.com”- x " http:// <代理>:< >港”

使用以下方法

curl -I -x 192.168.XX: XX http://google.com

192.168.X。X:XX输入您的代理服务器ip和端口。

-v verbose模式,它将提供更多的详细信息,包括头和响应。