@Override
    public final HttpRoute determineRoute(final HttpHost host, final HttpRequest request, final HttpContext context) throws HttpException {
        if (host == null) {
            throw new ProtocolException("Target host is not specified");
        }
        final HttpClientContext clientContext = HttpClientContext.cast(context);
        final RequestConfig config = clientContext.getRequestConfigOrDefault();
        @SuppressWarnings("deprecation")
        HttpHost proxy = config.getProxy();
        if (proxy == null) {
            proxy = determineProxy(host, context);
        }
        final HttpHost target = RoutingSupport.normalize(host, schemePortResolver);
        if (target.getPort() < 0) {
            throw new ProtocolException("Unroutable protocol scheme: " + target);
        }
        final boolean secure = URIScheme.HTTPS.same(target.getSchemeName());
        final URIAuthority authority;
        if (secure && request != null && !sameNamedEndpoint(request.getAuthority(), host)) {
            authority = request.getAuthority();
        } else {
            authority = null;
        }

        final Path unixDomainSocket = config.getUnixDomainSocket();
        if (unixDomainSocket != null) {
            if (proxy != null) {
                throw new UnsupportedOperationException("Proxies are not supported over Unix domain sockets");
            } else if (secure) {
                throw new UnsupportedOperationException("HTTPS is not supported over Unix domain sockets");
            }
            return new HttpRoute(target, unixDomainSocket);
        }
        final InetAddress inetAddress = determineLocalAddress(target, context);
        if (proxy == null) {
            return new HttpRoute(target, authority, inetAddress, secure);
        }
        return new HttpRoute(target, authority, inetAddress, proxy, secure);
    }
Default implementation of an {@link HttpRoutePlanner}. It will not make use of
any Java system properties, nor of system or browser proxy settings.

@since 4.3
httpclient5/src/main/java/org/apache/hc/client5/http/impl/routing/DefaultRoutePlanner.java