cURL:https通过代理 [英] cURL: https through a proxy

查看:1029
本文介绍了cURL:https通过代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要向https网址发出cURL请求,但我还必须通过代理。这是否有一些问题?我一直有这么多麻烦这样做curl和php,我试着用urllib2在Python中,只是发现urllib2不能POST到https当通过代理。我没有找到任何与cURL这样的文档,但我想知道是否有人知道这是否是一个问题?

I need to make a cURL request to a https URL, but I have to go through a proxy as well. Is there some problem with doing this? I have been having so much trouble doing this with curl and php, that I tried doing it with urllib2 in Python, only to find that urllib2 cannot POST to https when going through a proxy. I haven't been able to find any documentation to this effect with cURL, but I was wondering if anyone knew if this was an issue?

推荐答案

例如,w /命令行,除非你使用命令行curl。配置的证书,您需要 -k 切换。要通过代理,它是 -x 切换。

For example, w/ command-line, unless you've configured certificates, you'll need -k switch. And to go through a proxy, it's the -x <proxyhost[:port]> switch.

我相信 -k 等效的是

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

我相信 -x / p>

I believe the -x equivalent is

curl_setopt($curl, CURLOPT_PROXY, '<proxyhost[:port]>');








免责声明:我没有测试任何
这。如果您提供更多关于您尝试的资讯
,可能是
有用。

这篇关于cURL:https通过代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆