Code example for AuthScope

0
		 
		httpClient = new DefaultHttpClient(cm, params);
		 
		// authentication 
		if (user != null && passwd != null) {
			httpClient.getCredentialsProvider().setCredentials(
	                new AuthScope(hostname, port),
	                new UsernamePasswordCredentials(user, passwd));
		} 
	} 
 
	public HttpClient getHttpClient() {
		return httpClient;
	} 
	 
	@Override 
	protected JSONObject doJSONRequest(JSONObject jsonRequest) throws JSONRPCException
	{ 
		// Create HTTP/POST request with a JSON entity containing the request 
		HttpPost request = new HttpPost("http://"+hostname+":"+port+"/jsonrpc");
//		HttpParams params = new BasicHttpParams();