loopj/android-async-http — pull request #210 by snowdream (2013-04-16 03:03:40+00:00)
Title: Add a method for setting the proxy

/**
* Sets the Proxy
* @param hostname the hostname (IP or DNS我· name)
* @param port the port number. -1 indicates the scheme default port.
*/
public void setProxy(String hostname, int port){
final HttpHost proxy = new HttpHost(hostname, port);
final HttpParams httpParams = this.httpClient.getParams();
httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}

Usage:
AsyncHttpClient client = new AsyncHttpClient();
client.setProxy("10.0.0.172",80);
client.get("http://www.google.com", new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
System.out.println(response);
}
});