Code example for SchemeRegistry

0
            // Setting timeout 
            HttpConnectionParams.setConnectionTimeout(params, 100000);
            HttpConnectionParams.setSoTimeout(params, 100000);
 
            // Registering schemes for both HTTP and HTTPS 
            SchemeRegistry registry = new SchemeRegistry();
            registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
            registry.register(new Scheme("https", sf, 443));
 
            // Creating thread safe client connection manager 
            ClientConnectionManager ccm = new ThreadSafeClientConnManager(params, registry);
 
            // Creating HTTP client 
            client = new DefaultHttpClient(ccm, params);
 
        } catch (Exception e) {
            client = new DefaultHttpClient();
        } 
 
        return client;
    }