https://github.com/dunglas/php-torcontrol
PHP TorControl, a library to control TOR
https://github.com/dunglas/php-torcontrol
php tor
Last synced: 6 months ago
JSON representation
PHP TorControl, a library to control TOR
- Host: GitHub
- URL: https://github.com/dunglas/php-torcontrol
- Owner: dunglas
- License: mit
- Created: 2013-02-23T22:04:44.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-08-09T13:01:50.000Z (over 7 years ago)
- Last Synced: 2025-05-09T12:09:24.559Z (6 months ago)
- Topics: php, tor
- Language: PHP
- Homepage: http://dunglas.fr/2013/02/php-torcontrol-a-library-to-control-tor/
- Size: 387 KB
- Stars: 88
- Watchers: 9
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tor - php-torcontrol - TorControl is a PHP library to control a Tor server. (Applications / Other applications)
- awesome-network-stuff - **76**星
- awesome-tor - PHP TorControl - PHP library to control a Tor server. (Uncategorized / Uncategorized)
README
PHP TorControl, a library to control TOR
========================================
TorControl is a PHP library to control a [Tor](https://www.torproject.org/) server.
[](https://travis-ci.org/dunglas/php-torcontrol)
[](https://insight.sensiolabs.com/projects/82838db8-eff6-42bb-b4b6-c2d128a62d98)
[](https://styleci.io/repos/8382630)
Features
--------
* Connect to a Tor server through network socket, SSL network socket or UNIX socket
* Support null, password and cookie file authentication methods
* Automatic authentication for null and cookie file methods
* Multi-line replies
* Unit-tested with PHPUnit
* Installation with Composer
Installation
------------
Note: if you use the [Symfony](http://symfony.com) framework, you should use [DunglasTorControlBundle](https://github.com/dunglas/DunglasTorControlBundle).
If not already done, install [Composer](http://getcomposer.org/).
Add php-torcontrol to your `composer.json`:
composer require dunglas/php-torcontrol
Usage
-----
```php
'localhost',
'port' => 9051,
'password' => 'MySecr3tPassw0rd',
'authmethod' => 1
)
);
$tc->connect();
$tc->authenticate();
// Renew identity
$res = $tc->executeCommand('SIGNAL NEWNYM');
// Echo the server reply code and message
echo $res[0]['code'].': '.$res[0]['message'];
// Quit
$tc->quit();
```
Related
-------
* [Tor Control protocol](https://gitweb.torproject.org/torspec.git/tree/control-spec.txt)
Credits
-------
PHP TorControl has been created by [Kévin Dunglas](http://dunglas.fr).