Code example for AuthScope

0
						new HttpHost(proxy, proxyPort, protocol));
			} 
			DefaultHttpClient client = new DefaultHttpClient(
					configureConnectionManager(params), params);
			if (username != null && password != null) {
				client.getCredentialsProvider().setCredentials(
						new AuthScope(host, port, AuthScope.ANY_REALM),
						new UsernamePasswordCredentials(username, password));
				client.addRequestInterceptor(
						new PreemptiveAuthRequestInterceptor(), 0); 
			} 
 
 
 
			return client;
		} 
 
		public Builder port(int i) {
			port = i;
			return this;
Contextual code suggestions in your IDE  Get Codota for Java