使用 cURL 执行 HTTP 请求(使用 PROXY)

新手上路,请多包涵

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

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

原文由 user873286 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 741
2 个回答

一般方式:

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

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

并且,根据下面的评论,对于 https:

 export https_proxy=https://your.proxy.server:port/

原文由 airween 发布,翻译遵循 CC BY-SA 4.0 许可协议

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.

原文由 Karl Barker 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题