Code example for SchemeRegistry

Methods: register

0
		 
		if (this.mPort != port) {
		 
			// Proxy port has changed so set up appropriate HttpClient 
			this.mPort = port;
			SchemeRegistry supportedSchemes = new SchemeRegistry();
			 
			supportedSchemes.register(new Scheme("http", new SocksSocketFactory("127.0.0.1", port), 80));
			 
			// SSL support is broken at the moment 
	        supportedSchemes.register(new Scheme("https", 
	                SSLSocketFactory.getSocketFactory("127.0.0.1", port), 443));
 
	        // prepare parameters 
	        HttpParams params = new BasicHttpParams();
	        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
	        HttpProtocolParams.setContentCharset(params, "UTF-8");
	        HttpProtocolParams.setUseExpectContinue(params, true);
 
	        ClientConnectionManager ccm = new MyThreadSafeClientConnManager(params, 
	                supportedSchemes);
 
	        mClient = new DefaultHttpClient(ccm, params);
		} 
	} 
Connect your IDE to all the code out there  Get Codota for Java