class
TorControl::Client
- TorControl::Client
- Reference
- Object
Defined in:
config.crevents.cr
features.cr
get_info.cr
no_arg_commands.cr
onion.cr
send_signal.cr
tor_control.cr
Constant Summary
-
Log =
::Log.for("torcontrol.client") -
ProtocolLog =
::Log.for("torcontrol.client.protocol")
Constructors
Macro Summary
Instance Method Summary
-
#add_onion(key_type : OnionKeyType, key_blob : OnionKeyBlob | String, *ports : UInt | NamedTuple(port: UInt, target: Socket::Address | Nil), flags : Array(OnionFlag) = [] of OnionFlag, max_streams : UInt = 0, pow_enabled : Bool | Nil = nil, pow_q_rate : UInt | Nil = nil, pow_q_burst : UInt | Nil = nil, client_auth_v2 = [] of NamedTuple(name: String, blob: String | ::Nil), client_auth_v3 = [] of String)
TODO check address, blob, & nick_name against regex
- #auth_cookie_file : Path | Nil
- #auth_methods : AuthMethod
- #authenticate(authentication : String | Path | Nil = nil, auth_methods : AuthMethod = @auth_methods)
- #authenticated? : Bool
- #del_onion(service_id : String)
-
#drop_guards
Tells the server to drop all guard nodes.
-
#drop_ownership
This command instructs Tor to relinquish ownership of its control connection.
-
#drop_timeouts
Tells the server to drop all circuit build times.
- #event_subscribers : Array(Tuple(Set(Event), Channel(AsyncReply)))
- #events : Set(Event)
- #get_conf
- #get_info(info : String)
- #get_info(info : String, *infos : String)
- #load_conf
- #on_disconnect(&on_disconnect_proc)
- #onion_client_auth_add(hs_address : String, private_key_blob : PrivateKeyBlob, nick_name : String | Nil = nil, permanent : Bool = false)
- #onion_client_auth_remove(hs_address)
-
#onion_client_auth_view(hs_address : String | Nil = nil)
List all the stored client-side v3 client auth credentials for “HSAddress” if provided else all the stored client-side v3 client auth credentials.
- #post_descriptor(purpose : RouterPurpose = RouterPurpose::General, cache : Bool | Nil = nil)
-
#protocol_info
Can only be sent once before authentication, which the constructor already does.
- #quit
- #reset_conf
-
#resolve(host : String, reverse : Bool = false)
This command launches a remote hostname lookup request for every specified request (or reverse lookup if reverse is specified).
- #save_conf(force : Bool = false)
- #set_conf(key, value)
- #set_router_purpose(descriptor, nick_name_or_key : String, purpose : RouterPurpose)
-
#signal(signal : Signal)
Sent from the client to the server.
- #socket=(socket : Socket)
-
#subscribe_events(events : Set(Event), capacity : Int32 = 0) : Channel(AsyncReply)
Receive all asyncronous replies for the given event types.
-
#subscribe_events(*events : Event, capacity : Int32 = 0) : Channel(AsyncReply)
Receive all asyncronous replies for the given event types.
-
#subscribe_events(events : Set(Event), capacity : Int32 = 0, &)
Yields all asyncronous replies for the given event types.
-
#subscribe_events(*events : Event, capacity : Int32 = 0, &)
Yields all asyncronous replies for the given event types.
-
#take_ownership
This command instructs Tor to shut down when this control connection is closed.
- #tor_version : String | Nil
- #use_feature(*features : Feature)
Constructor Detail
Macro Detail
Instance Method Detail
TODO check address, blob, & nick_name against regex
Tells the server to drop all guard nodes. Do not invoke this command lightly; it can increase vulnerability to tracking attacks over time. Tor replies with 250 OK on success.
This command instructs Tor to relinquish ownership of its control connection. As such tor will not shut down when this control connection is closed.
Tells the server to drop all circuit build times. Do not invoke this command lightly; it can increase vulnerability to tracking attacks over time. Tor replies with 250 OK on success. Tor also emits the BUILDTIMEOUT_SET RESET event right after this 250 OK.
List all the stored client-side v3 client auth credentials for “HSAddress” if provided else all the stored client-side v3 client auth credentials.
Can only be sent once before authentication, which the constructor already does.
This command launches a remote hostname lookup request for every specified request (or reverse lookup if reverse is specified). Note that the request is done in the background: to see the answers, your controller will need to listen for ADDRMAP events
Sent from the client to the server. The server responds with 250 OK if the signal is recognized (or simply closes the socket if it was asked to close immediately), or 552 Unrecognized signal if the signal is unrecognized.
Receive all asyncronous replies for the given event types. Take care to not to let the Channel fill up and ensure to close it, as it could otherwise block the receiver. Increase the capacity if necessary.
Receive all asyncronous replies for the given event types. Take care to not to let the Channel fill up and ensure to close it, as it could otherwise block the receiver. Increase the capacity if necessary.
Yields all asyncronous replies for the given event types. Take care to procces the reply in time as it could otherwise block the receiver. Increase the capacity if necessary
Yields all asyncronous replies for the given event types. Take care to procces the reply in time as it could otherwise block the receiver. Increase the capacity if necessary
This command instructs Tor to shut down when this control connection is closed.