[ https://issues.apache.org/jira/browse/HTTPCLIENT-2240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17620492#comment-17620492 ]
Rostyslav Smirnov commented on HTTPCLIENT-2240: ----------------------------------------------- {code:java} import org.apache.hc.client5.http.auth.UsernamePasswordCredentials; import org.apache.hc.client5.http.impl.classic.ProxyClient; import org.apache.hc.core5.http.HttpHost; public class ProxyClientTest { public static void main(String[] args) throws Exception { new ProxyClient().tunnel(HttpHost.create("http://localhost:3128"), HttpHost.create("iso.org"), new UsernamePasswordCredentials("user", "password".toCharArray())); } }{code} > ProxyClient always throws ProtocolException > ------------------------------------------- > > Key: HTTPCLIENT-2240 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2240 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (classic) > Affects Versions: 5.1.3 > Reporter: Rostyslav Smirnov > Priority: Major > > When setting up HTTP proxy tunnel using ProxyClient, the following exception > is thrown: > > {code:java} > Exception in thread "main" org.apache.hc.core5.http.ProtocolException: Target > host is unknown > at > org.apache.hc.core5.http.protocol.RequestTargetHost.process(RequestTargetHost.java:77) > at > org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(DefaultHttpProcessor.java:107) > at > org.apache.hc.core5.http.impl.io.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:246) > at > org.apache.hc.client5.http.impl.classic.ProxyClient.tunnel(ProxyClient.java:174) > at ProxyClientTest.main(ProxyClientTest.java:7){code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org