I wrote a native module (in rust
) and connected it to my Android
application (via react-native
expo
).
I’m able to run HTTP
requests only to http://10.0.2.2
.
I added:
<uses-permission android:name="android.permission.INTERNET"/>
And android:networkSecurityConfig="@xml/network_security_config"
that points to:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system"/>
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
<domain includeSubdomains="true">10.0.0.1</domain>
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">ngrok-free.app</domain>
</domain-config>
</network-security-config>
But this didn’t help.