【发布时间】:2016-07-09 18:42:49
【问题描述】:
所以我正在尝试 cURL 到一个洋葱网站,例如:facebookcorewwwi.onion 我会有以下代码:
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($curl, CURLOPT_URL, 'http://facebookcorewwwi.onion/');
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_HTTPGET, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_PROXY, '127.0.0.1:9050');
curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
$html = curl_exec($curl);
var_dump($html);
这给出了以下输出:
布尔(假)
但这不是我想要的结果,我想要实际的页面内容!
inb4:是的,我打开了 Tor 浏览器
curl_error 给出以下错误:
错误:无法连接到 127.0.0.1 端口 9050:连接被拒绝
【问题讨论】: