Code example for URI

Methods: getHosttoString, getEffectivePort

        private final SSLSocketFactory sslSocketFactory;
        public Address(URI uri, SSLSocketFactory sslSocketFactory) throws UnknownHostException {
            this.proxy = null;
            this.requiresTunnel = false;
            this.uriHost = uri.getHost();
            this.uriPort = uri.getEffectivePort();
            this.sslSocketFactory = sslSocketFactory;
            this.socketHost = uriHost;
            this.socketPort = uriPort;
            if (uriHost == null) {
                throw new UnknownHostException(uri.toString());
         * @param requiresTunnel true if the HTTP connection needs to tunnel one 
         *     protocol over another, such as when using HTTPS through an HTTP 
         *     proxy. When doing so, we must avoid buffering bytes intended for 
         *     the higher-level protocol.