Coder
Coder

Reputation: 111

Android:create a proxy server

How can i create a proxy server to monitor my users in my android..

I tried to create proxy server using this code ..But that not getting created..Did i do anything wrong in that please state..

public void setProxy(DefaultHttpClient httpclient) {  
    final String PROXY_IP = "127.0.0.1";  
     final int PROXY_PORT = 8080;  

     httpclient.getCredentialsProvider().setCredentials(  
             new AuthScope(PROXY_IP, PROXY_PORT),  
             new UsernamePasswordCredentials(  
                     "root", "password"));  

    HttpHost proxy = new HttpHost(PROXY_IP, PROXY_PORT);  

    httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,  
            proxy);  

}  

Upvotes: 1

Views: 2795

Answers (1)

Andrey Voitenkov
Andrey Voitenkov

Reputation: 665

In this way you are configuring proxy for your application's HttpClient. Recent versions of Android do not support system-wide proxy at all. Check this for some more details: How to set system wide proxy in ICS

Upvotes: 1

Related Questions