Code example for URI

Methods: getHost, getEffectivePort

0
        private final int socketPort;
 
        public Address(URI uri) {
            this.proxy = null;
            this.requiresTunnel = false;
            this.uriHost = uri.getHost();
            this.uriPort = uri.getEffectivePort();
            this.socketHost = uriHost;
            this.socketPort = uriPort;
        } 
 
        /** 
         * @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. 
         */ 
        public Address(URI uri, Proxy proxy, boolean requiresTunnel) {
            this.proxy = proxy;
            this.requiresTunnel = requiresTunnel;
Contextual code suggestions in your IDE  Get Codota for Java