ProxiedHttpClientFactory

@Singleton
class ProxiedHttpClientFactory @Inject constructor(proxyManager: ProxyManager, networkGuard: NetworkGuard)

Builds Ktor/OkHttp clients that are always configured to route through the current Tor SOCKS5 proxy, gated by NetworkGuard. Used by protocol adapters (e.g. Matrix) instead of constructing HTTP clients directly.

Constructors

Link copied to clipboard
@Inject
constructor(proxyManager: ProxyManager, networkGuard: NetworkGuard)

Functions

Link copied to clipboard
fun create(configure: HttpClientConfig<OkHttpConfig>.() -> Unit = {}): HttpClient

Builds a Ktor HttpClient on the OkHttp engine, pre-configured with the Tor SOCKS proxy.

Link copied to clipboard
fun okhttpClient(): OkHttpClient

Builds a raw OkHttpClient pre-configured with the Tor SOCKS proxy.