2

I know we can set proxy to webview by using reflection from here. But it doesn't work normally in 4.2.2

I use whatismyip.com to verify whether I am really connected to proxy. And I found that I must rotate the screen (run onCreate the second time) in order to connect to the proxy. So, what is the problem. Thanks

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    WebView wv = (WebView) findViewById(R.id.webView1);
    wv.setWebViewClient(new WebViewClient());
    Util.setProxyICSPlus(wv, "74.221.211.12", 8089, null);
    wv.loadUrl("http://www.whatismyip.com/");
}

WebView android proxy

Community
  • 1
  • 1
Bear
  • 5,138
  • 5
  • 50
  • 80
  • hi Bear can you give me what's that you use to set the proxy? I see that you are using Util.setProxyICSPlus. So can you give me that Util class or anything like that? Thanks, – Nicolas May 22 '13 at 03:29
  • I also from that answer, to add username-password authentication, you can simply follow this answer: https://stackoverflow.com/a/10752723/4206925 to write your own WebViewClient class. It worked in my case, hope this help! – MewX Dec 15 '17 at 06:22
  • I have the same issue. Did you solve it? please share it if there is any. thanks. – Behrouz.M Apr 01 '19 at 10:53

0 Answers0