php curl failed to resolve for socks5 connect, PHP CURL socks5 代理dns问题

php-curl是用socks5 代理不能解析主机名,两种解决办法

第一种:
Looks like CURLPROXY_SOCKS5_HOSTNAME is not defined in PHP, but you can explicitly use its value, which is equal to 7:
curl_setopt($ch, CURLOPT_PROXYTYPE, 7);
这样把DNS解析的工作交给tor

第二种:

安装Privoxy转换成http代理

参考:http://stackoverflow.com/questions/15445285/how-can-i-connect-to-a-tor-hidden-service-using-curl-in-php

发表评论

电子邮件地址不会被公开。

*