# ARTI API: allow\_onion\_addrs

**URL:** https://forum.torproject.org/t/arti-api-allow-onion-addrs/13340
**Category:** Arti Development
**Created:** [June 27, 2024, 9:58am UTC](https://forum.torproject.org/t/arti-api-allow-onion-addrs/13340 "2024-06-27T09:58:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sergioffpc](https://forum.torproject.org/user_avatar/forum.torproject.org/sergioffpc/32/5239_2.png) [@sergioffpc](https://forum.torproject.org/u/sergioffpc)
#### Post date: [June 27, 2024, 9:58am UTC](https://forum.torproject.org/t/arti-api-allow-onion-addrs/13340/1 "2024-06-27T09:58:35Z")

</div>

Hi,

I’m trying to use arti\_client API to connect to my Onion hidden service but I can’t create a TorClientConfig object with allow\_onion\_addrs set to TRUE. If I try to build a TorClientConfig with the following code:

> let config = TorClientConfig::builder().address\_filter().allow\_onion\_addrs(true).build();

I get ClientAddrConfig instead of a TorClientConfig.

Is this the right behaviour? How can I create a TorClientConfig with allow\_onion\_addrs set to TRUE?

Best regards,  
Sérgio Carvalho

---

<div class="post-metadata">

### Author: ![nickm](https://forum.torproject.org/user_avatar/forum.torproject.org/nickm/32/109_2.png) [@nickm](https://forum.torproject.org/u/nickm)
#### Post date: [June 27, 2024, 3:14pm UTC](https://forum.torproject.org/t/arti-api-allow-onion-addrs/13340/2 "2024-06-27T15:14:49Z")

</div>

Hi!

The `address_filter()` function returns a `&mut` reference to a sub-builder of type `ClientAddrConfigBuilder`. (That sub-builder is a member of the `TorClientConfigBuilder`.)

I think what you want to do here is more like:

```auto
let mut cfg_builder = TorClientConfig::builder();
cfg_builder.address_filter().allow_onion_addrs(true);
let config = cfg_builder.build();

```

Hope this helps!

---

<div class="post-metadata">

### Author: ![sergioffpc](https://forum.torproject.org/user_avatar/forum.torproject.org/sergioffpc/32/5239_2.png) [@sergioffpc](https://forum.torproject.org/u/sergioffpc)
#### Post date: [June 27, 2024, 4:23pm UTC](https://forum.torproject.org/t/arti-api-allow-onion-addrs/13340/3 "2024-06-27T16:23:22Z")

</div>

You right! My bad!

Thanks for the help!
