Code example for AuthScope

		httpClient = new DefaultHttpClient(cm, params);
		// authentication 
		if (user != null && passwd != null) {
	                new AuthScope(hostname, port),
	                new UsernamePasswordCredentials(user, passwd));
	public HttpClient getHttpClient() {
		return httpClient;
	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");
Stop searching for code, let great code find you!  Add Codota to your java IDE