Home > Backend Development > PHP Tutorial > PHP中让curl支持sock5的代码实例_php技巧

PHP中让curl支持sock5的代码实例_php技巧

WBOY
Release: 2016-05-16 20:25:34
Original
942 people have browsed it

复制代码 代码如下:

//最近需要用到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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template