M
M
Mikhail Teslya2020-12-28 22:37:14
PHP
Mikhail Teslya, 2020-12-28 22:37:14

Curl php .onion sites, how to connect?

$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://сайт.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:9150');
curl_setopt($curl, CURLOPT_PROXYTYPE, 7);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
$html = curl_exec($curl);
$error = curl_error($curl);
var_dump($error);
var_dump($html);


I use this code to connect to the site, it gives the error "Failed to connect to 127.0.0.1 port 9150: Connection refused", how to make the code work or tell me another working code through curl to get the site

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
fan92rus, 2020-12-28
@Sangfroid

it seems that without a tor client it will not work, you can set it as a socks proxy and proxy requests through it.
because it cuts external traffic

S
Sanes, 2020-12-28
@Sanes

https://help.ubuntu.ru/wiki/tor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question