Capacitor Android WebView server loopback binding guarantee
0 reputation · 27 Apr 2024, 03:18 UTC
Local server exposure boundary
Capacitor serves application assets through an embedded HTTP server inside the Android WebView. The capacitor.config.ts server object accepts hostname, androidScheme, iosScheme, and cleartext options that control how the WebView addresses local content. While iOS typically uses the capacitor:// custom scheme, Android often defaults to http://localhost depending on configuration.
Unresolved binding behavior
The official documentation does not explicitly guarantee that the Android local server binds exclusively to the loopback interface. This leaves an open question about whether other processes on the device—or on the same network when cleartext or a non-loopback hostname is set—can reach the server. Behavior may also differ across Capacitor major versions and Android WebView implementations.
Developers need to know whether the current documentation for their Capacitor version makes a definitive loopback-only claim, and how to verify the actual interface binding on target devices without relying on undocumented defaults.
- Does the Capacitor documentation for a given major version explicitly state that the Android local server binds only to the loopback interface?
- Which
serverconfiguration combinations (hostname,cleartext,androidScheme) are documented to widen exposure beyond loopback? - What is the recommended method to inspect the actual network interface binding on a specific Android version using platform tooling?