Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gared/tor-directory-client
https://github.com/gared/tor-directory-client
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/gared/tor-directory-client
- Owner: Gared
- Created: 2022-03-21T21:01:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-19T23:05:40.000Z (over 1 year ago)
- Last Synced: 2024-04-27T00:06:54.128Z (7 months ago)
- Language: PHP
- Size: 574 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tor-directory-client
Use this PHP library to request tor directory information
## Installation
Use composer
```console
composer require gared/tor-directory-client
```## Getting started
### Usage
```php
$client = new \Gared\TorDirectoryClient\Client();
$serverDescriptor = $client->getServerDescriptor('FINGERPRINTABC');// get consensus data
$routerDescriptors = $client->getConsensus();// get consensus data
$votes = $client->getAllVotes();
foreach ($votes as $vote) {
foreach ($vote as $routerDescriptor) {
echo $routerDescriptor->getFingerprint();
}
}
```## Supported Platforms
* You need at least PHP 7.4
## Supported Requests
| API | Code |
|------------------------------------|---------------------------------|
| /tor/status-vote/current/consensus | $client->getConsensus(); |
| /tor/status-vote/current/authority | $client->getAllVotes(); |
| /tor/server/fp/%s | $client->getServerDescriptor(); |