You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
594 B
33 lines
594 B
4 years ago
|
<?php
|
||
|
|
||
|
class CurlTorProject extends Curl {
|
||
|
|
||
|
public function getExitNodes() {
|
||
|
|
||
|
$this->prepare('torbulkexitlist', 'GET');
|
||
|
|
||
|
if ($response = $this->execute(false)) {
|
||
|
|
||
|
$list = explode("\n", $response);
|
||
|
|
||
|
if (count($list)) {
|
||
|
|
||
|
$sanitized = [];
|
||
|
foreach ($list as $ip) {
|
||
|
|
||
|
$ip = $this->sanitize($ip);
|
||
|
|
||
|
if ($ip) {
|
||
|
$sanitized[] = $ip;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
return $sanitized;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|