From 23a60cf20a8140bff51541b705ad6860cfc1b1f8 Mon Sep 17 00:00:00 2001
From: hayaksi1 <193020925+hayaksi1@users.noreply.github.com>
Date: Tue, 25 Aug 2026 15:54:45 +0300
Subject: [PATCH] Point the proxy debugging doc at the method that builds the
clients
The doc told the reader to add disableSslVerification() to
RustMatrixClientFactory.create(), which has not built the client for a long
time; getBaseClientBuilder() is where the chain lives, and it covers both the
login client and the restored session client.
It also only described the emulator's own proxy setting, while the app already
follows the device's global proxy through DefaultProxyProvider, which is the
only way to do this on a physical device.
---
docs/debug_proxying.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/debug_proxying.md b/docs/debug_proxying.md
index a28163c959..f76c24eecb 100644
--- a/docs/debug_proxying.md
+++ b/docs/debug_proxying.md
@@ -9,13 +9,18 @@
1) Set `127.0.0.1` as "Host name" and `8080` as "Port number".
1) Click "Apply" and verify that "Proxy status" is "Success" and close the settings window.
+ 1) Alternatively, set the proxy on the device itself, which the app honours through `DefaultProxyProvider`, and which also works on a physical device:
+ ```
+ adb shell settings put global http_proxy 10.0.2.2:8080
+ ```
+ Use `adb shell settings delete global http_proxy` to remove it afterwards. On a physical device, replace `10.0.2.2` with the address of the machine running mitmproxy.
1) Install the mitmproxy CA cert (this is needed to see traffic from java/kotlin code, it's not needed for traffic coming from native code e.g. the matrix-rust-sdk).
1) Open the emulator Chrome browser app
1) Go to the url `mitm.it`
1) Follow the instructions to install the CA cert on Android devices.
1) Slightly modify the Element X app source code.
- 1) Go to the `RustMatrixClientFactory.create()` method.
+ 1) Go to the `RustMatrixClientFactory.getBaseClientBuilder()` method, which builds every client the app creates, whether it is logging in or restoring a session.
1) Add `.disableSslVerification()` in the `ClientBuilder` method chain.
1) Build and run the Element X app.
1) Enjoy, you will see all the traffic in mitmproxy's web interface.