hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joan Balaguero" <joan.balagu...@grupoventus.com>
Subject HttpHost thread-safe?
Date Wed, 10 Oct 2012 14:53:02 GMT
Hello,

 

When I implement a router planner like this:

 

( . . . )

public HttpRoute determineRoute(HttpHost target, HttpRequest request,
HttpContext context) throws HttpException 

{

  boolean isHttps = "https".equalsIgnoreCase(target.getSchemeName());

  HttpHost proxy  = isHttps ? httpsProxy : httpProxy;

                

  if (proxy == null) return new HttpRoute(target, null, isHttps);

  return new HttpRoute(target, null, proxy, isHttps);

}

 

Can I pass to HttpRoute an already constructed HttpHost (like above)? Or
should I build a new HttpHost like “return new HttpRoute(target, null, new
HttpHost(proxy.getHostName(), proxy.getPort(), proxy.getSchemeName()),
isHttps);” ?

 

Thanks,

 

Joan.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message