原文地址:Apache HttpClient and Charles Web Debugging Proxy
DefaultHttpClient client = new DefaultHttpClient();
// you can set various parameters for your client here.
// set up the proxy.
HttpHost proxy = new HttpHost("localhost", 8888);
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);