Code example for PlainSocketFactory

	private static DefaultHttpClient httpClient = null;
	private static void ensureClient() { 
		if (httpClient == null) {
			SchemeRegistry registry = new SchemeRegistry();
			registry.register(new Scheme("http", new PlainSocketFactory(), 80));
			HttpParams httpparams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpparams, TIMEOUT);
			HttpConnectionParams.setSoTimeout(httpparams, TIMEOUT);
			HttpProtocolParams.setUserAgent(httpparams, USER_AGENT);
			httpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(httpparams, registry), httpparams);
			// TODO: See if we can enable this again; RateBeer seemd to have problems with sending GZipped content 
	public static String makeRBGet(String url) throws ClientProtocolException, IOException {
		return getResponseString(makeRawRBGet(url));
Connect your IDE to all the code out there  Get Codota for Java