当前位置:首页 > PHP教程 > PHP高级教程

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

复制代码 代码如下:

//最近需要用到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 速度很快 哈哈 


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!