Code example for PlainSocketFactory

0
		HttpConnectionParams.setConnectionTimeout(httpParams, connectionTimeOut);
		HttpConnectionParams.setSoTimeout(httpParams, socketTimeOut);
		HttpConnectionParams.setSocketBufferSize(httpParams, 8192);
 
		final SchemeRegistry registry = new SchemeRegistry();
		registry.register(new Scheme("http", new PlainSocketFactory(), 80));
		registry.register(new Scheme("https", (new FakeSocketFactory()), 443));
 
		final ClientConnectionManager clientConnectionManager = new ThreadSafeClientConnManager(httpParams, registry);
		final DefaultHttpClient httpClient = new DefaultHttpClient(clientConnectionManager, httpParams);
 
		final HttpRequestRetryHandler retryHandler = new SocketTimeOutRetryHandler(httpParams, maxNrRetries);
		httpClient.setHttpRequestRetryHandler(retryHandler);
 
		return httpClient;
	} 
 
	/** 
	 * @return Credentials to use with this HttpRequest or null if no credentials were supplied. 
	 */ 
	private UsernamePasswordCredentials getCredentials()