TorControl
Control a Tor server using the socket connection. The spec of the control protocol: https://gitweb.torproject.org/torspec.git/blob_plain/HEAD:/control-spec.txt
| author | Kévin Dunglas |
|---|
__construct(array $options)
arrayConfiguration settings All settings are optional. - hostname: server to join (default: 127.0.0.1) - port: port to try (default: 9051) - authmethod: connection method (if not set will try to autodetect) Allowed values: - TorControl::AUTH_METHOD_NULL: no security - TorControl::AUTH_METHOD_HASHEDPASSWORD: password - TorControl::AUTH_METHOD_COOKIE: cookie file - password: the password (mandatory if AUTH_METHOD_HASHEDPASSWORD is used) - cookiefile: the file (if TorControl::AUTH_METHOD_COOKIE is used, if not set will autodetect) - timeout: connection timeout (default: default_socket_timeout's PHP setting)
__destruct()
authenticate() : \TorControl\TorControl
executeCommand(string $cmd) : array
string
\TorControl\Exception\IOError |
|
|---|---|
\TorControl\Exception\ProtocolError |
arraygetOption(string $key) : mixed
string
mixedisConnected() : boolean
booleanquit()
quote(string $str) : string
string
stringdetectAuthMethod()
\TorControl\Exception\ProtocolError |
|---|
$connected : boolean
$defautOptions : array
$socket : resource
AUTH_METHOD_COOKIE
AUTH_METHOD_HASHEDPASSWORD
AUTH_METHOD_NOT_SET
AUTH_METHOD_NULL