cordova-plugin-webview-proxy icon indicating copy to clipboard operation
cordova-plugin-webview-proxy copied to clipboard

Android proxy implementation

Open NiklasMerz opened this issue 4 years ago • 4 comments
trafficstars

POST requests don't work on Android for now.

NiklasMerz avatar Jul 14 '21 12:07 NiklasMerz

@NiklasMerz Is there anything I can do to help get this merged and available? We're using this plugin for iOS purposes, but would like to update to Android 10's https protocol, and the proxy is the best approach we have to getting it working.

mattdsteele avatar Jan 06 '22 15:01 mattdsteele

We stopped pursuing this idea of an Android proxy after we found our that Android's APIs make it impossible to do a POST request. It will still work for GET requests though.

Not sure if I would want the Android part if only GET works but if you or someone else needs this I would consider merging this.

NiklasMerz avatar Jan 06 '22 18:01 NiklasMerz

Yikes, that is... quite the limitation. I'm not sure it would be useful as GET only for our use case either.

Do you recall what the API limitation was? I wonder if there's anything we could learn from other implementations, like the Capacitor HTTP client: https://github.com/capacitor-community/http

mattdsteele avatar Jan 06 '22 18:01 mattdsteele

This PR uses WebViewAssetLoader. This Android API is intended for app developers to load assets from the local file system with a proper origin.

Contrary to iOS these "path handlers" don't get information like the HTTP method used or request body. This is why we couldn't implement the proxy like on iOS.

NiklasMerz avatar Jan 08 '22 13:01 NiklasMerz