/** * Creates a HttpHostConnectException based on original {@link java.io.IOException}. * * @since 4.3 */ public HttpHostConnectException( final IOException cause, final HttpHost host, final InetAddress... remoteAddresses) { super("Connect to " + (host != null ? host.toHostString() : "remote host") + (remoteAddresses != null && remoteAddresses .length > 0 ? " " + Arrays.asList(remoteAddresses) : "") + ((cause != null && cause.getMessage() != null) ? " failed: " + cause.getMessage() : " refused")); this.host = host; initCause(cause); }
/** * Creates a ConnectTimeoutException based on original {@link IOException}. * * @since 4.3 */ public ConnectTimeoutException( final IOException cause, final HttpHost host, final InetAddress... remoteAddresses) { super("Connect to " + (host != null ? host.toHostString() : "remote host") + (remoteAddresses != null && remoteAddresses.length > 0 ? " " + Arrays.asList(remoteAddresses) : "") + ((cause != null && cause.getMessage() != null) ? " failed: " + cause.getMessage() : " timed out")); this.host = host; initCause(cause); }
if (ex instanceof NoHttpResponseException) { final NoHttpResponseException updatedex = new NoHttpResponseException( route.getTargetHost().toHostString() + " failed to respond"); updatedex.setStackTrace(ex.getStackTrace()); throw updatedex;
request.addHeader(HTTP.TARGET_HOST, targethost.toHostString());
if (ex instanceof NoHttpResponseException) { final NoHttpResponseException updatedex = new NoHttpResponseException( route.getTargetHost().toHostString() + " failed to respond"); updatedex.setStackTrace(ex.getStackTrace()); throw updatedex;
try { if (this.log.isDebugEnabled()) { this.log.debug(host.toHostString() + " requested authentication");
HttpResponse response = null; final String authority = target.toHostString(); final HttpRequest connect = new BasicHttpRequest("CONNECT", authority, request.getProtocolVersion());
"CONNECT", host.toHostString(), HttpVersion.HTTP_1_1);