Code example for HttpHost

0
                if (mCursor != null && mCursor.moveToFirst()) {
                    // 游标移至第一条记录,当然也只有一条 
                    String proxyStr = mCursor.getString(mCursor.getColumnIndex("proxy"));
                    if (proxyStr != null && proxyStr.trim().length() > 0) {
                        HttpHost proxy = new HttpHost(proxyStr, 80);
                        client.getParams().setParameter(ConnRouteParams.DEFAULT_PROXY, proxy);
                    } 
                    mCursor.close();
                } 
            } 
            return client;
        } catch (Exception e) {
            return new DefaultHttpClient();
        } 
    } 
 
    public static class MySSLSocketFactory extends SSLSocketFactory {
        SSLContext sslContext = SSLContext.getInstance("TLS");
 
        public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException,
                KeyManagementException, KeyStoreException, UnrecoverableKeyException {