Home > php教程 > php手册 > body text

PHP中让curl支持sock5的代码实例,curlsock5

WBOY
Release: 2016-06-13 09:16:57
Original
1140 people have browsed it

PHP中让curl支持sock5的代码实例,curlsock5

复制代码 代码如下:


//最近需要用到curl测试代理是否可用,代理是sock5非http的 所以需要在curl中增加几句。 
 
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); 
curl_setopt($ch, CURLOPT_PROXY, "0.0.0.0:8080"); 
curl_setopt($ch,CURLOPT_PROXYUSERPWD, "username:pwd"); 
 
//测试ok 速度很快 哈哈 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!