php curl使用代理发起请求
来源:互联网 发布:淘宝助理 顺丰模板 编辑:程序博客网 时间:2024/05/16 08:05
以下是代码实测可用,使用的时候记得自己去找可用的ip和端口
curl使用说明,参数查询 http://dev.21tx.com/2010/02/04/10511.html
<?php$requestUrl = 'http://www.baidu.com';$type = 'http';$cUrl = curl_init();curl_setopt($cUrl, CURLOPT_URL, $requestUrl);curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($cUrl, CURLOPT_TIMEOUT, 10);curl_setopt($cUrl, CURLOPT_PROXY, '61.135.164.220:80'); //做代理的ip和端口if($type=='https'){ //不使用证书curl_setopt($cUrl, CURLOPT_SSL_VERIFYPEER, FALSE);curl_setopt($cUrl, CURLOPT_SSL_VERIFYHOST, FALSE);}echo $pageContent = trim(curl_exec($cUrl));curl_close($cUrl);
curl使用说明,参数查询 http://dev.21tx.com/2010/02/04/10511.html
- php curl使用代理发起请求
- php使用curl发起http请求
- 使用cURL发起https请求
- 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- http 使用curl发起https请求
- php curl发起post请求(json和xml)
- http 使用curl发起https请求 error 60 51
- 使用php发起多线程cc请求
- PHP发起异步请求
- CURL单线程请求(使用代理IP)
- curl 多线程请求 (可使用代理IP)
- curl如何发起DELETE/PUT请求
- ASP.NET温故而知新学习系列之ASP.NET多线程编程—.NET下的多线程编程应用程序域(七)
- 商务英语:英语邮件常用语
- IOS展示音量警告框
- UVA 152 一堆树
- 最大子段和
- php curl使用代理发起请求
- Cocoa之Core Data 框架详解
- poj 1703 Find them, Catch them(种类并查集)
- CSS学习——基本语法(一)
- 表单参数与URL参数的优先级
- iPhone的Push(推送通知)功能原理浅析
- 手机屏幕DPI计算
- hdu——2045(找规律的递推题)
- paip.程序模块间的通讯方式大总结