private static int portOf(URI u) {
        return u.getPort() == -1 ? u.getScheme().equals("http") ? 80 : 443 : u.getPort();
    }
Client implementation based on Jetty HTTP Client

@author bjorncs
vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java