Code example for ProtocolException

0
                        targethost = new HttpHost(address.getHostName(), port);
                    } 
                } 
                if (targethost == null) {
                    if (ver.lessEquals(HttpVersion.HTTP_1_0)) {
                        return; 
                    } else { 
                        throw new ProtocolException("Target host missing");
                    } 
                } 
            } 
            request.addHeader(HTTP.TARGET_HOST, targethost.toHostString());
        } 
    } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java