<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorControlClient/setConf(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ControlClientC7setConfyySDyS2SSgGYaKF"
  },
  "title" : "setConf(_:)"
}
-->

# setConf(_:)

Issue a `SETCONF` command to mutate Tor’s runtime configuration.

```
func setConf(_ options: [String : String?]) async throws
```

## Parameters

`options`

Dictionary of torrc option names to
optional string values. Pass `nil` as a value to reset.

## Discussion

Composes the command body per control-spec.txt §3.1: each
option with a non-`nil` value becomes `Key="Value"` (double
quotes escape internal quotes); each option with a `nil`
value becomes the bare `Key` form, which resets the option to
its configured default.

> Throws: ``doc://Tor/documentation/Tor/TorError/controlProtocolError(code:message:)`` on
> rejection (e.g. reply 553 “invalid config value”).

> Important: Not all torrc options are settable at runtime —
> Tor rejects immutable options with reply 553. Consult
> tor.1.txt for the per-option mutability annotation before
> building a mutation.