首先,我已经阅读了所有与我的问题类似的问题的答案。但没有一个解决方案帮助了我。
这是我的Webview代码
mWebView.loadUrl(siteUrl);
mWebView.getSettings().setUserAgentString(ua);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.setWebViewClient(new mWebViewClient());
字符串
我尝试使用这个类https://gist.github.com/madeye/2297083
我用这段代码来设置代理
ProxySettings.setProxy(getApplicationContext(), "x.x.x.x", 8080);
型
我还测试了这个类https://gist.github.com/WanghongLin/50032a4d3933960454a7
和/或
WebViewHttpProxy.setProxy(mWebView,"x.x.x.x",8080);
型
但都不管用。当我运行应用程序时,代理没有应用
2条答案
按热度按时间mspsb9vt1#
非常容易在您的Android Webview应用程序上设置代理
compile 'android.webkit:webkit:1.3.0' setProxy();在你的webview URL加载之前加载。
字符串
好好享受
rjee0c152#
我不确定,但我觉得你在加载URL(
webView.loadUrl
)后设置代理,所以它可能不适用