Source:
private <T> Future<List<InetSocketAddress>> resolveAddresses(Request request, ProxyServer proxy, NettyResponseFuture<T> future, AsyncHandler<T> asyncHandler) { Uri uri = request.getUri(); final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise(); if (proxy != null && !proxy.isIgnoredForHost(uri.getHost()) && proxy.getProxyType().isHttp()) { int port = uri.isSecured() ? proxy.getSecuredPort() : proxy.getPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(proxy.getHost(), port); scheduleRequestTimeout(future, unresolvedRemoteAddress); return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler); } else if (proxy != null && proxy.isResolveDomain() && ProxyType.SOCKS_V5 == proxy.getProxyType()) { int port = uri.getExplicitPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port); final Promise<List<InetSocketAddress>> unResolvedPromise = ImmediateEventExecutor.INSTANCE.newPromise(); List<InetSocketAddress> unresolvedLiWrapper = new ArrayList<>(1); unresolvedLiWrapper.add(unresolvedRemoteAddress); scheduleRequestTimeout(future, unresolvedRemoteAddress); unResolvedPromise.trySuccess(unresolvedLiWrapper); return unResolvedPromise; } else { int port = uri.getExplicitPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port); scheduleRequestTimeout(future, unresolvedRemoteAddress); if (request.getAddress() != null) { InetSocketAddress inetSocketAddress = new InetSocketAddress(request.getAddress(), port); return promise.setSuccess(singletonList(inetSocketAddress)); } else { return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler); } } }

Target:
private <T> Future<List<InetSocketAddress>> resolveAddresses(Request request, ProxyServer proxy, NettyResponseFuture<T> future, AsyncHandler<T> asyncHandler) { Uri uri = request.getUri(); final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise(); if (proxy != null && !proxy.isIgnoredForHost(uri.getHost()) && proxy.getProxyType().isHttp()) { int port = uri.isSecured() ? proxy.getSecuredPort() : proxy.getPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(proxy.getHost(), port); scheduleRequestTimeout(future, unresolvedRemoteAddress); return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler); } else if (proxy != null && proxy.isResolveDomain() && proxy.getProxyType().isSocks()) { int port = uri.getExplicitPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port); final Promise<List<InetSocketAddress>> unResolvedPromise = ImmediateEventExecutor.INSTANCE.newPromise(); List<InetSocketAddress> unresolvedLiWrapper = new ArrayList<>(1); unresolvedLiWrapper.add(unresolvedRemoteAddress); scheduleRequestTimeout(future, unresolvedRemoteAddress); unResolvedPromise.trySuccess(unresolvedLiWrapper); return unResolvedPromise; } else { int port = uri.getExplicitPort(); InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port); scheduleRequestTimeout(future, unresolvedRemoteAddress); if (request.getAddress() != null) { InetSocketAddress inetSocketAddress = new InetSocketAddress(request.getAddress(), port); return promise.setSuccess(singletonList(inetSocketAddress)); } else { return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler); } } }