Code example for SingleClientConnManager

0
		schemeRegistry.register(new Scheme("http", PlainSocketFactory
				.getSocketFactory(), 80));
		schemeRegistry.register(new Scheme("https", SSLSocketFactory
				.getSocketFactory(), 443));
 
		SingleClientConnManager cm = new SingleClientConnManager(params,
				schemeRegistry);
 
		DefaultHttpClient client = new DefaultHttpClient(cm, params);
 
		client.addRequestInterceptor(new HttpRequestInterceptor() {
 
			public void process(HttpRequest request, HttpContext context)
					throws HttpException, IOException { 
				request
						.addHeader(
								"User-Agent", 
								"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 GTB6 (.NET CLR 3.5.30729)"); 
 
			} 
		});