Skip to content

Commit

Permalink
Add Web View
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna authored Oct 13, 2023
1 parent 23a9727 commit 1f7ec47
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions x/mobileproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,19 @@ In the JVM, you can configure the proxy to use with [system properties](https://
```kotlin
System.setProperty("http.proxyHost", "localhost")
System.setProperty("http.proxyPort", "1234")
System.setProperty("https.proxyHost", "localhost")
System.setProperty("https.proxyPort", "1234")
```

Note that this may not fully work on Android, since it will only affect the JVM, not native code. You should also make sure you set this early in your code.

### Web View

We are working on instructions on how use the local proxy in a Webview.

On Android, you will likely have to implement [WebViewClient.shouldInterceptRequest](https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest)) to fulfill requests using an HTTP client that uses the local proxy.

On iOS, we are still looking for ideas. There's [WKWebViewConfiguration.setURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/2875766-seturlschemehandler), but the documentation says it can't be used to intercept HTTPS. If you know how do use a proxy with WKWebView, please let us know!

## Clean up

Expand Down

0 comments on commit 1f7ec47

Please sign in to comment.