Android Proxy Setting

安稳与你 提交于 2019-12-04 21:17:10

Have you tried Android Proxy Library ? https://github.com/shouldit/android-proxy-library

It's maybe a solution for you

Problem Solved. in webview onCreate i have to call url. like this web = callURL(); and to load url use loadDatawithBaseUrl. after that you have to make a public class callURL(){ . set the proxy in there. like this

DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpHost proxy = new HttpHost("your host", your proxy); //proxy that i need
    httpClient.getParams().setParameter(ConnRouteParams.DEFAULT_PROXY, proxy);
    httpClient.getCredentialsProvider().setCredentials(  
            new AuthScope("your host", your proxy),  
            new UsernamePasswordCredentials(  
                    "your username", "your password"));

and then in httpget. call your url too. thats it. good luck

Try the following method. I dont know this is whether correct or not. Just try.

DefaultHttpClient httpClient = new DefaultHttpClient();
httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY,new
 NTCredentials(user, pass, null, null));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!